Doctrine\ODM\MongoDB\Persisters\DocumentPersister::refresh PHP Method

refresh() public method

Refreshes a managed document.
public refresh ( array $id, object $document )
$id array The identifier of the document.
$document object The document to refresh.
    public function refresh($id, $document)
    {
        $data = $this->collection->findOne(array('_id' => $id));
        $this->dm->getHydrator()->hydrate($document, $data);
        $this->uow->setOriginalDocumentData($document, $data);
    }