/** * 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); }
/** * 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); }