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

Merges the state of the given detached entity into this UnitOfWork.
public merge ( object $entity ) : object
$entity object
Результат object The managed copy of the entity.
Пример #1
0
 /**
  * Merges the state of a detached entity into the persistence context
  * of this EntityManager and returns the managed copy of the entity.
  * The entity passed to merge will not become associated/managed with this EntityManager.
  *
  * @param object $entity The detached entity to merge into the persistence context.
  * @return object The managed copy of the entity.
  */
 public function merge($entity)
 {
     if (!is_object($entity)) {
         throw new \InvalidArgumentException(gettype($entity));
     }
     $this->errorIfClosed();
     return $this->unitOfWork->merge($entity);
 }
Пример #2
0
 /**
  * Merges the state of a detached entity into the persistence context
  * of this EntityManager and returns the managed copy of the entity.
  * The entity passed to merge will not become associated/managed with this EntityManager.
  *
  * @param object $entity The detached entity to merge into the persistence context.
  * @return object The managed copy of the entity.
  */
 public function merge($entity)
 {
     if (!is_object($entity)) {
         throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity);
     }
     $this->errorIfClosed();
     return $this->unitOfWork->merge($entity);
 }