コード例 #1
0
ファイル: Collection.php プロジェクト: BaguettePHP/phactory
 public function __construct($singular_name, $pluralize = true, Phactory $phactory)
 {
     $this->_singular = $singular_name;
     if ($pluralize) {
         $this->_name = Inflector::pluralize($singular_name);
     } else {
         $this->_name = $singular_name;
     }
     $this->_collection = $phactory->getDb()->selectCollection($this->_name);
 }
コード例 #2
0
ファイル: PhactoryMongoTest.php プロジェクト: nrocy/phactory
 public function testGetDb()
 {
     $db = Phactory::getDb();
     $this->assertInstanceOf('MongoDB', $db);
 }