private function getCollection($type) {
        if ($this->collections[$type] === null) {
            try {
                $this->collections[$type] = $this->getMongoClient()->selectCollection(
                    $this->params['databaseName'],
                    $type
                );
            } catch (MongoException $e) {
                throw new DatabaseException('Could not select collection', 500, $e);
            }
        }

        return $this->collections[$type];
    }
private function getCollection($type) {
        if ($this->collections[$type] === null) {
            try {
                $this->collections[$type] = $this->getMongoClient()->selectCollection(
                    $this->params['databaseName'],
                    $type
                );
            } catch (MongoException $e) {
                throw new DatabaseException('Could not select collection', 500, $e);
            }
        }

        return $this->collections[$type];
    }
private function getCollection ( $ type ) { if ( $ this -> collections [ $ type ] === null ) { try { $ this -> collections [ $ type ] = $ this -> getMongoClient ( ) -> selectCollection ( $ this -> params [ 'databaseName' ] , $ type ) ; } catch ( MongoException $ e ) { throw new DatabaseException ( 'Could not select collection' , 500 , $ e ) ; } } return $ this -> collections [ $ type ] ; }
Get the mongo collection instance

@param string $type "image" or "shortUrl"
@return MongoCollection
Get the mongo collection instance