/** * Set email and, if there is no username set, set the email as username * @param string $email * @return $this|\FOS\UserBundle\Model\UserInterface */ public function setEmail($email) { if (!$this->username) { $this->username = $email; } return parent::setEmail($email); }
/** * override original setter, with set username with email. * * {@inheritDoc} * * @see \FOS\UserBundle\Model\User::setEmail() */ public function setEmail($email) { parent::setEmail($email); $this->setUsername($email); return $this; }
/** * Set email * * @param string $email * @return User */ public function setEmail($email) { $email = is_null($email) ? '' : $email; parent::setEmail($email); if (!empty($email)) { $this->setUsername($email); } return $this; }
/** * @param string $email * * @return $this */ public function setEmail($email) { $email = is_null($email) ? '' : $email; parent::setEmail($email); $this->setUsername($email); return $this; }
public function setEmail($email) { parent::setEmail($email); }