Doctrine\ODM\MongoDB\UnitOfWork::refresh PHP Method

refresh() public method

Refreshes the state of the given document from the database, overwriting any local, unpersisted changes.
public refresh ( object $document )
$document object The document to refresh.
    public function refresh($document)
    {
        $visited = array();
        $this->doRefresh($document, $visited);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * Refreshes the persistent state of a document from the database,
  * overriding any local changes that have not yet been persisted.
  *
  * @param object $document The document to refresh.
  */
 public function refresh($document)
 {
     if (!is_object($document)) {
         throw new \InvalidArgumentException(gettype($document));
     }
     $this->errorIfClosed();
     $this->unitOfWork->refresh($document);
 }
UnitOfWork