/**
  * Persist this entity, inserting it if new and otherwise updating it
  *
  * @param  AbstractEntity $entity
  * @return AbstractEntity
  */
 public function persist(AbstractEntity $entity)
 {
     /** @var InserterTrait $this */
     if ($entity->isNew()) {
         return $this->insert($entity);
     }
     /** @var UpdaterTrait $this */
     return $this->update($entity);
 }
Esempio n. 2
0
 /**
  * Persist this entity, inserting it if new and otherwise updating it
  *
  * @param  AbstractEntity $entity
  * @return AbstractEntity
  */
 public function persist(AbstractEntity $entity)
 {
     if ($entity->isNew()) {
         return $this->insert($entity);
     }
     return $this->update($entity);
 }