/** * @param \Secretary\Entity\Key $key * @param \Secretary\Entity\User $user * @return \Secretary\Entity\Key */ public function saveKey(KeyEntity $key, UserEntity $user, $pubKey) { $key->setPubKey($pubKey); $key->setUserId($user->getId()); $key->setUser($user); $this->em->persist($key); $this->em->flush(); return $key; }
/** * {@inheritDoc} */ public function setUserId($userId) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setUserId', array($userId)); return parent::setUserId($userId); }