Last active
December 20, 2015 19:58
-
-
Save fitzagard/6186479 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\models; | |
class Base extends \lithium\data\Model { | |
/** | |
* This method gives direct access to the MongoDB collection object from any | |
* model that extends the Base Model. | |
* @return object | |
*/ | |
public static function collection() { | |
return static::connection()->connection->{static::_object()->_meta['source']}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment