/** * Static function for checking hashed password (as required by Doctrine) * * @param snUser\Entity\User $user The identity object * @param string $passwordGiven Password provided to be verified * @return boolean true if the password was correct, else, returns false */ public static function verifyHashedPassword(User $user, $passwordGiven) { $bcrypt = new Bcrypt(array('cost' => 10)); return $bcrypt->verify($passwordGiven, $user->getPassword()); }
/** * Remove myFriend * * @param User $user * @return User */ public function removeMyFriend(\BkdUser\Entity\User $user) { $user->removeFriendWithMe($this); // synchronously updating inverse side. $this->myFriends->removeElement($user); return $this; }