本文整理汇总了PHP中FOS\UserBundle\Model\UserManagerInterface::updatePassword方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManagerInterface::updatePassword方法的具体用法?PHP UserManagerInterface::updatePassword怎么用?PHP UserManagerInterface::updatePassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOS\UserBundle\Model\UserManagerInterface
的用法示例。
在下文中一共展示了UserManagerInterface::updatePassword方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateUserFields
/**
* This must be called on prePersist and preUpdate if the event is about a
* user.
*
* @param UserInterface $user
*/
protected function updateUserFields(UserInterface $user)
{
if (null === $this->userManager) {
$this->userManager = $this->container->get('fos_user.user_manager');
}
$this->userManager->updateCanonicalFields($user);
$this->userManager->updatePassword($user);
}
示例2: handleEvent
private function handleEvent(LifecycleEventArgs $args)
{
if (null === $this->userManager) {
$this->userManager = $this->container->get('fos_user.user_manager');
}
$entity = $args->getEntity();
if ($entity instanceof UserInterface) {
$this->userManager->updateCanonicalFields($entity);
$this->userManager->updatePassword($entity);
}
}
示例3: handleEvent
private function handleEvent(LifecycleEventArgs $args)
{
$entity = $args->getDocument();
if ($entity instanceof UserInterface) {
if (null === $this->userManager) {
$this->userManager = $this->container->get('fos_user.user_manager');
}
$this->userManager->updateCanonicalFields($entity);
$this->userManager->updatePassword($entity);
if ($args instanceof PreUpdateEventArgs) {
// We are doing a update, so we must force Doctrine to update the
// changeset in case we changed something above
$dm = $args->getDocumentManager();
$uow = $dm->getUnitOfWork();
$meta = $dm->getClassMetadata(get_class($entity));
$uow->recomputeSingleDocumentChangeSet($meta, $entity);
}
}
}
示例4: updateUserFields
/**
* This must be called on prePersist and preUpdate if the event is about a
* user.
*
* @param UserInterface $user
*/
protected function updateUserFields(UserInterface $user)
{
if (null === $this->userDiscriminator) {
$this->userDiscriminator = $this->container->get('rollerworks_multi_user.user_discriminator');
}
// Can only use the user manager when there is an user-system active
if (null === $this->userDiscriminator->getCurrentUser() || true !== $this->userDiscriminator->getCurrentUserConfig()->getConfig('use_listener', true)) {
return;
}
if (null === $this->userManager) {
$this->userManager = $this->container->get('fos_user.user_manager');
}
$this->userManager->updateCanonicalFields($user);
$this->userManager->updatePassword($user);
}