本文整理汇总了PHP中AppBundle\Entity\User::getPlainPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getPlainPassword方法的具体用法?PHP User::getPlainPassword怎么用?PHP User::getPlainPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppBundle\Entity\User
的用法示例。
在下文中一共展示了User::getPlainPassword方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handleEvent
private function handleEvent(User $user)
{
if (!$user->getPlainPassword()) {
return;
}
$plainPassword = $user->getPlainPassword();
$encoder = $this->encoderFactory->getEncoder($user);
$password = $encoder->encodePassword($plainPassword, $user->getSalt());
$user->setPassword($password);
}
示例2: handleEvent
private function handleEvent(User $user)
{
if (!$user->getPlainPassword()) {
return;
}
$plainPassword = $user->getPlainPassword();
$encoder = $this->encoderFactory->getEncoder($user);
$password = $encoder->encodePassword($plainPassword, $user->getSalt());
$user->setPassword($password);
//Make sure that a user has at least the role of ROLE_USER when created
$roles = $user->getRoles();
$user->setRoles($roles);
}
示例3: updatePassword
private function updatePassword(User $entity)
{
if ($entity->getPlainPassword()) {
$password = $this->encoder->encodePassword($entity, $entity->getPlainPassword());
$entity->setPassword($password);
}
}
示例4: encodePassword
private function encodePassword(User $user)
{
$plainPassword = $user->getPlainPassword();
if (!is_null($plainPassword)) {
$user->setPassword($this->passwordEncoder->encodePassword($user, $plainPassword));
}
}
示例5: updatePassword
/**
* @param User $user
*/
private function updatePassword(User $user)
{
$password = $user->getPlainPassword();
if (0 !== strlen($password)) {
$encoder = $this->encoder->getEncoder($user);
$user->setPassword($encoder->encodePassword($password, $user->getSalt()));
$user->eraseCredentials();
}
}
示例6: save
public function save(User $user)
{
$new = !$user->getId();
$generatedPassword = $user->getPlainPassword();
//TODO - permission?
try {
$this->entityManager->persist($user);
$this->entityManager->flush();
} catch (DBALException $e) {
throw new UserException('Uživatel s tímto e-mailem již existuje');
}
if ($new) {
$this->userCreate->send($user, $generatedPassword);
}
}
示例7: getPlainPassword
/**
* {@inheritDoc}
*/
public function getPlainPassword()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getPlainPassword', []);
return parent::getPlainPassword();
}