Skip to content

Instantly share code, notes, and snippets.

@fitzagard
Last active December 20, 2015 19:58
Show Gist options
  • Save fitzagard/6186479 to your computer and use it in GitHub Desktop.
Save fitzagard/6186479 to your computer and use it in GitHub Desktop.
<?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