/** * Get incomming Email document and update its read status and date read to current date * @param unknown $data data to be updated * @return Ambigous <multitype:, array> */ public function getOne($data) { $document = $this->_dm->find($this->_documentClassName, (string) $data->id); if ($document->getUnread()) { $document->setUnread(false); $document->setDateRead(date('m/d/Y h:i:s a', time())); $this->_dm->persist($document); $this->_dm->flush(); } return parent::getOne($data); }