Nextras\Orm\Entity\IEntity::getRepository PHP Method

getRepository() public method

Returns entity repository.
public getRepository ( boolean $need = true ) : Nextras\Orm\Repository\IRepository | null
$need boolean
return Nextras\Orm\Repository\IRepository | null
    public function getRepository($need = true);

Usage Example

コード例 #1
0
ファイル: HasMany.php プロジェクト: nextras/orm
 /**
  * @return ICollection
  */
 protected function getCachedCollection()
 {
     $key = spl_object_hash($this->parent->getPreloadContainer()) . '_' . $this->metadata->name;
     $cache = $this->parent->getRepository()->getMapper()->getCollectionCache();
     if (!isset($cache->{$key})) {
         $cache->{$key} = $this->createCollection();
     }
     $this->collection = $cache->{$key};
     return $cache->{$key};
 }
All Usage Examples Of Nextras\Orm\Entity\IEntity::getRepository