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