persist() public method

Persist the entity with cascade.
public persist ( Nextras\Orm\Entity\IEntity $entity, $withCascade = true ) : Nextras\Orm\Entity\IEntity
$entity Nextras\Orm\Entity\IEntity
return Nextras\Orm\Entity\IEntity
コード例 #1
0
ファイル: Repository.php プロジェクト: JanTvrdik/nextras-orm
 /** @inheritdoc */
 public function persist(IEntity $entity, $withCascade = TRUE)
 {
     $this->identityMap->check($entity);
     if ($withCascade) {
         return $this->model->persist($entity);
     }
     $this->attach($entity);
     $this->doFireEvent($entity, 'onBeforePersist');
     $this->doPersist($entity);
     return $entity;
 }
コード例 #2
0
ファイル: Repository.php プロジェクト: nextras/orm
 /** @inheritdoc */
 public function persist(IEntity $entity, $withCascade = true)
 {
     $this->identityMap->check($entity);
     return $this->model->persist($entity, $withCascade);
 }