src/Persister/EntityPersister.php
public function refresh($id, $entity)
    {
        $label = $this->classMetadata->getLabel();
        $query = sprintf('MATCH (n:%s) WHERE id(n) = {%s} RETURN n', $label, 'id');
        $result = $this->entityManager->getDatabaseDriver()->run($query, ['id' => $id]);

        if ($result->size() > 0) {
            $node = $result->firstRecord()->nodeValue('n');
            $this->entityManager->getEntityHydrator($this->className)->refresh($node, $entity);
        }
    }
public function refresh($id, $entity)
    {
        $label = $this->classMetadata->getLabel();
        $query = sprintf('MATCH (n:%s) WHERE id(n) = {%s} RETURN n', $label, 'id');
        $result = $this->entityManager->getDatabaseDriver()->run($query, ['id' => $id]);

        if ($result->size() > 0) {
            $node = $result->firstRecord()->nodeValue('n');
            $this->entityManager->getEntityHydrator($this->className)->refresh($node, $entity);
        }
    }
public function refresh ( $ id , $ entity ) { $ label = $ this -> classMetadata -> getLabel ( ) ; $ query = sprintf ( 'MATCH (n:%s) WHERE id(n) = {%s} RETURN n' , $ label , 'id' ) ; $ result = $ this -> entityManager -> getDatabaseDriver ( ) -> run ( $ query , [ 'id' => $ id ] ) ; if ( $ result -> size ( ) > 0 ) { $ node = $ result -> firstRecord ( ) -> nodeValue ( 'n' ) ; $ this -> entityManager -> getEntityHydrator ( $ this -> className ) -> refresh ( $ node , $ entity ) ; } }
Refreshes a managed entity.

@param int    $id
@param object $entity The entity to refresh
Refreshes a managed entity .