public function getGridFS($name = 'fs')
    {
        // return from pool
        if ($this->collectionPoolEnabled && isset($this->collectionPool[$name])) {
            return $this->collectionPool[$name];
        }

        // no object in pool - init new
        $classDefinition = $this->getCollectionDefinition($name, array('gridfs' => true));
        $className = $classDefinition->getClass();

        // create collection class
        $collection = new $className($this, $name, $classDefinition);
        if (!$collection instanceof \Sokil\Mongo\GridFS) {
            throw new Exception('Must be instance of \Sokil\Mongo\GridFS');
        }

        // store to pool
        if ($this->collectionPoolEnabled) {
            $this->collectionPool[$name] = $collection;
        }

        // return
        return $collection;
    }
public function getGridFS($name = 'fs')
    {
        // return from pool
        if ($this->collectionPoolEnabled && isset($this->collectionPool[$name])) {
            return $this->collectionPool[$name];
        }

        // no object in pool - init new
        $classDefinition = $this->getCollectionDefinition($name, array('gridfs' => true));
        $className = $classDefinition->getClass();

        // create collection class
        $collection = new $className($this, $name, $classDefinition);
        if (!$collection instanceof \Sokil\Mongo\GridFS) {
            throw new Exception('Must be instance of \Sokil\Mongo\GridFS');
        }

        // store to pool
        if ($this->collectionPoolEnabled) {
            $this->collectionPool[$name] = $collection;
        }

        // return
        return $collection;
    }
public function getGridFS ( $ name = 'fs' ) { // return from pool if ( $ this -> collectionPoolEnabled && isset ( $ this -> collectionPool [ $ name ] ) ) { return $ this -> collectionPool [ $ name ] ; } // no object in pool - init new $ classDefinition = $ this -> getCollectionDefinition ( $ name , array ( 'gridfs' => true ) ) ; $ className = $ classDefinition -> getClass ( ) ; // create collection class $ collection = new $ className ( $ this , $ name , $ classDefinition ) ; if ( ! $ collection instanceof \ Sokil \ Mongo \ GridFS ) { throw new Exception ( 'Must be instance of \Sokil\Mongo\GridFS' ) ; } // store to pool if ( $ this -> collectionPoolEnabled ) { $ this -> collectionPool [ $ name ] = $ collection ; } // return return $ collection ; }
Get instance of GridFS

@param string $name prefix of files and chunks collection
@return \Sokil\Mongo\GridFS
@throws \Sokil\Mongo\Exception
Get instance of GridFS