Пример #1
0
 /**
  * Allow for driver changes.
  */
 public function getPrimaryKey()
 {
     if ($this->getDriver() instanceof \Titon\Db\Mongo\MongoDriver) {
         return '_id';
     }
     return parent::getPrimaryKey();
 }
Пример #2
0
 public function testGetPrimaryKeyNoSchema()
 {
     $repo = new Repository(['table' => 'profiles', 'primaryKey' => null]);
     $this->assertEquals('id', $repo->getPrimaryKey());
 }