refresh() public method

Refreshes the state of the given entity from the database, overwriting any local, unpersisted changes.
public refresh ( object $entity )
$entity object The entity to refresh.
Beispiel #1
0
 /**
  * Refreshes the persistent state of an entity from the database,
  * overriding any local changes that have not yet been persisted.
  *
  * @param object $entity The entity to refresh.
  */
 public function refresh($entity)
 {
     if (!is_object($entity)) {
         throw new \InvalidArgumentException(gettype($entity));
     }
     $this->errorIfClosed();
     $this->unitOfWork->refresh($entity);
 }
 /**
  * Refreshes the persistent state of an entity from the database,
  * overriding any local changes that have not yet been persisted.
  *
  * @param object $entity The entity to refresh.
  */
 public function refresh($entity)
 {
     if (!is_object($entity)) {
         throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
     }
     $this->errorIfClosed();
     $this->unitOfWork->refresh($entity);
 }