Example #1
0
 /**
  * Fix repo for MongoDB.
  */
 public function getRepository()
 {
     $driver = Database::registry()->getDriver('default');
     if ($driver instanceof MongoDriver && !$this->_repository) {
         $this->setRepository(new Collection(['connection' => $this->connection, 'table' => $this->table, 'prefix' => $this->prefix, 'primaryKey' => '_id', 'displayField' => $this->displayField, 'entity' => get_class($this)]));
     }
     return parent::getRepository();
 }