Пример #1
0
 /**
  * Refresh the given document by querying the PHPCR to get the current state.
  *
  * @param object $document
  * @return object Document instance
  */
 public function refresh($document)
 {
     $this->errorIfClosed();
     $this->session->refresh(true);
     $node = $this->session->getNode($this->unitOfWork->getDocumentId($document));
     $hints = array('refresh' => true);
     return $this->unitOfWork->createDocument(get_class($document), $node, $hints);
 }
Пример #2
0
 /**
  * Refresh the given document by querying the PHPCR to get the current state.
  *
  * @param object $document
  * @return object Document instance
  */
 public function refresh($document)
 {
     if (!is_object($document)) {
         throw new \InvalidArgumentException(gettype($document));
     }
     $this->errorIfClosed();
     $this->session->refresh(true);
     $node = $this->session->getNode($this->unitOfWork->getDocumentId($document));
     $hints = array('refresh' => true);
     return $this->unitOfWork->createDocument(get_class($document), $node, $hints);
 }