public function getCollection()
    {
        if (!$this->collection) {
            // gridfs
            if ($this->isFile) {
                $this->collection = $this->getConnection()->getMongoDB()->getGridFS($this->collectionName);
            // normal
            } else {
                $this->collection = $this->getConnection()->getMongoDB()->selectCollection($this->collectionName);
            }
        }

        return $this->collection;
    }
public function getCollection()
    {
        if (!$this->collection) {
            // gridfs
            if ($this->isFile) {
                $this->collection = $this->getConnection()->getMongoDB()->getGridFS($this->collectionName);
            // normal
            } else {
                $this->collection = $this->getConnection()->getMongoDB()->selectCollection($this->collectionName);
            }
        }

        return $this->collection;
    }
public function getCollection ( ) { if ( ! $ this -> collection ) { // gridfs if ( $ this -> isFile ) { $ this -> collection = $ this -> getConnection ( ) -> getMongoDB ( ) -> getGridFS ( $ this -> collectionName ) ; // normal } else { $ this -> collection = $ this -> getConnection ( ) -> getMongoDB ( ) -> selectCollection ( $ this -> collectionName ) ; } } return $ this -> collection ; }
Returns the collection.

@return \MongoCollection The collection.

@api
Returns the collection .