public function setUserPassword(User $user, $password)
    {
        $user->setPassword($this->encodeUserPassword($user, $password));
    }
public function setUserPassword(User $user, $password)
    {
        $user->setPassword($this->encodeUserPassword($user, $password));
    }
public function setUserPassword ( User $ user , $ password ) { $ user -> setPassword ( $ this -> encodeUserPassword ( $ user , $ password ) ) ; }
Encode a plain text password and set it on the given User object.

@param User $user
@param string $password A plain text password.
Encode a plain text password and set it on the given User object .