public function refresh()
    {
        if ($this->isNew()) {
            throw new \LogicException('The document is new.');
        }

        $this->setDocumentData($this->getRepository()->getCollection()->findOne(array('_id' => $this->getId())), true);

        return $this;
    }
public function refresh()
    {
        if ($this->isNew()) {
            throw new \LogicException('The document is new.');
        }

        $this->setDocumentData($this->getRepository()->getCollection()->findOne(array('_id' => $this->getId())), true);

        return $this;
    }
public function refresh ( ) { if ( $ this -> isNew ( ) ) { throw new \ LogicException ( 'The document is new.' ) ; } $ this -> setDocumentData ( $ this -> getRepository ( ) -> getCollection ( ) -> findOne ( array ( '_id' => $ this -> getId ( ) ) ) , true ) ; return $ this ; }
Refresh the document data from the database.

@return \Mandango\Document\Document The document (fluent interface).

@throws \LogicException

@api
Refresh the document data from the database .