persist() публичный Метод

public persist ( Nextras\Orm\Entity\IEntity $entity, boolean $withCascade = true ) : mixed
$entity Nextras\Orm\Entity\IEntity
$withCascade boolean
Результат mixed
Пример #1
0
 public function persistEntity(bool $flush = FALSE)
 {
     $containers = iterator_to_array($this->getComponents(TRUE, self::class));
     array_walk($containers, function (self $container) {
         $container->initEntityRelations();
     });
     $this->setValues($this->getValues());
     $this->repository->persist($this->entity);
     if ($flush) {
         $this->repository->flush();
     }
 }