/** * {@inheritDoc} */ public function getContent() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getContent', array()); return parent::getContent(); }
/** * @param Entity\User $user * @param Entity\Note $note * @return Entity\Note */ public function updateUserNote(Entity\User $user, Entity\Note $note) { $encryptData = $this->getCryptService()->encryptForSingleKey($note->getContent(), $user->getKey()->getPubKey()); $note->setContent($encryptData['content']); $this->em->persist($note); $this->em->flush(); /** @var Entity\User2Note $user2Note */ $user2Note = $this->getUser2NoteRepository()->findOneBy(array('userId' => $user->getId(), 'noteId' => $note->getId())); $user2Note->setEKey($encryptData['ekey']); $note->addUser2Note($user2Note); $this->em->persist($note); $this->em->flush(); return $note; }