public function map($name, $classDefinition = null)
    {
        // map collection to class
        if ($classDefinition) {
            return $this->defineCollection($name, $classDefinition);
        }

        // map collections to classes
        if (is_array($name)) {
            foreach ($name as $collectionName => $classDefinition) {
                $this->defineCollection($collectionName, $classDefinition);
            }
            return $this;
        }

        // define class prefix
        // deprecated: use class definition
        $this->defineCollection('*', array(
            'class' => $name,
        ));

        return $this;
    }
public function map($name, $classDefinition = null)
    {
        // map collection to class
        if ($classDefinition) {
            return $this->defineCollection($name, $classDefinition);
        }

        // map collections to classes
        if (is_array($name)) {
            foreach ($name as $collectionName => $classDefinition) {
                $this->defineCollection($collectionName, $classDefinition);
            }
            return $this;
        }

        // define class prefix
        // deprecated: use class definition
        $this->defineCollection('*', array(
            'class' => $name,
        ));

        return $this;
    }
public function map ( $ name , $ classDefinition = null ) { // map collection to class if ( $ classDefinition ) { return $ this -> defineCollection ( $ name , $ classDefinition ) ; } // map collections to classes if ( is_array ( $ name ) ) { foreach ( $ name as $ collectionName => $ classDefinition ) { $ this -> defineCollection ( $ collectionName , $ classDefinition ) ; } return $ this ; } // define class prefix // deprecated: use class definition $ this -> defineCollection ( '*' , array ( 'class' => $ name , ) ) ; return $ this ; }
Map collection name to class

@param string|array $name collection name or array like [collectionName => collectionClass, ...]
@param string|array|Definition|null $classDefinition if $name is string, then full class name or array with parameters, else omitted

@return Database

@throws Exception
Map collection name to class