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