should be method `$user->generatePassword($password)`.