Shanty_Mongo_Document::_getMongoCollection PHP Method

_getMongoCollection() public method

Fetch an instance of MongoCollection
public _getMongoCollection ( boolean $writable = true ) : MongoCollection
$writable boolean
return MongoCollection
    public function _getMongoCollection($writable = true)
    {
        if (is_null($this->getConfigAttribute('collection'))) {
            require_once 'Shanty/Mongo/Exception.php';
            throw new Shanty_Mongo_Exception('Can not fetch instance of MongoCollection. Document is not connected to a collection.');
        }
        return $this->_getMongoDb($writable)->selectCollection($this->getConfigAttribute('collection'));
    }