private function defineCollection($name, $definition)
    {
        // prepare definition object
        if (false === ($definition instanceof Definition)) {
            if (is_string($definition)) {
                $definition = new Definition(array('class' => $definition));
            } elseif (is_array($definition)) {
                $definition = new Definition($definition);
            } else {
                throw new Exception(sprintf('Wrong definition passed for collection %s', $name));
            }
        }

        // set definition
        if ('/' !== substr($name, 0, 1)) {
            $this->mapping[$name] = $definition;
        } else {
            $this->regexpMapping[$name] = $definition;
        }

        return $this;
    }
private function defineCollection($name, $definition)
    {
        // prepare definition object
        if (false === ($definition instanceof Definition)) {
            if (is_string($definition)) {
                $definition = new Definition(array('class' => $definition));
            } elseif (is_array($definition)) {
                $definition = new Definition($definition);
            } else {
                throw new Exception(sprintf('Wrong definition passed for collection %s', $name));
            }
        }

        // set definition
        if ('/' !== substr($name, 0, 1)) {
            $this->mapping[$name] = $definition;
        } else {
            $this->regexpMapping[$name] = $definition;
        }

        return $this;
    }
private function defineCollection ( $ name , $ definition ) { // prepare definition object if ( false === ( $ definition instanceof Definition ) ) { if ( is_string ( $ definition ) ) { $ definition = new Definition ( array ( 'class' => $ definition ) ) ; } elseif ( is_array ( $ definition ) ) { $ definition = new Definition ( $ definition ) ; } else { throw new Exception ( sprintf ( 'Wrong definition passed for collection %s' , $ name ) ) ; } } // set definition if ( '/' !== substr ( $ name , 0 , 1 ) ) { $ this -> mapping [ $ name ] = $ definition ; } else { $ this -> regexpMapping [ $ name ] = $ definition ; } return $ this ; }
Define collection through array or Definition instance

@param string $name collection name
@param Definition|array|string $definition collection definition

@return Database

@throws Exception
Define collection through array or Definition instance