/** * 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); }
/** * 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); }
/** * Clear the current session. */ public function clear() { $this->session->refresh(false); }