/** * Returns true if passed user is currently authenticated * * @param AbstractUser $user * @return bool */ protected function isCurrentUser(AbstractUser $user) { $token = $this->security->getToken(); $currentUser = $token ? $token->getUser() : null; if ($user->getId() && is_object($currentUser)) { return $currentUser->getId() == $user->getId(); } return false; }
/** * Constructor * * The real implementation of this method is auto generated. * * IMPORTANT: If the derived class has own constructor it must call parent constructor. */ public function __construct() { parent::__construct(); }
/** * @param string $username * @return AccountUser */ public function setUsername($username) { parent::setUsername($username); $this->email = $username; return $this; }