当前位置: 首页>>代码示例>>PHP>>正文


PHP UserManagerInterface::deleteUser方法代码示例

本文整理汇总了PHP中FOS\UserBundle\Model\UserManagerInterface::deleteUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserManagerInterface::deleteUser方法的具体用法?PHP UserManagerInterface::deleteUser怎么用?PHP UserManagerInterface::deleteUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FOS\UserBundle\Model\UserManagerInterface的用法示例。


在下文中一共展示了UserManagerInterface::deleteUser方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteObject

 /**
  * Removes the given user object.
  *
  * @param DataEvent $event
  */
 public function deleteObject(DataEvent $event)
 {
     $object = $event->getData();
     if ($object instanceof UserInterface) {
         $this->userManager->deleteUser($object);
         $this->eventDispatcher->dispatch(Events::POST_DELETE, $event);
         $event->stopPropagation();
     }
 }
开发者ID:reminec,项目名称:DunglasApiBundle,代码行数:14,代码来源:EventSubscriber.php

示例2: deteleAll

 public function deteleAll()
 {
     $users = $this->userManager->findUsers();
     foreach ($users as $user) {
         $this->userManager->deleteUser($user);
     }
 }
开发者ID:bixlabs,项目名称:concepto-sises,代码行数:7,代码来源:UserManipulator.php

示例3: onKernelView

 /**
  * Persists, updates or delete data return by the controller if applicable.
  *
  * @param GetResponseForControllerResultEvent $event
  */
 public function onKernelView(GetResponseForControllerResultEvent $event)
 {
     $user = $event->getControllerResult();
     if (!$user instanceof UserInterface) {
         return;
     }
     switch ($event->getRequest()->getMethod()) {
         case Request::METHOD_POST:
         case Request::METHOD_PUT:
             $this->userManager->updateUser($user, false);
             break;
         case Request::METHOD_DELETE:
             $this->userManager->deleteUser($user);
             $event->setControllerResult(null);
             break;
     }
 }
开发者ID:ZeBigDuck,项目名称:DunglasApiBundle,代码行数:22,代码来源:EventListener.php

示例4: delete

 /**
  * Removes the User from the database.
  *
  * @param \Hal\Resource $resource
  *
  * @throws NotFoundHttpException if no user with the given id could be found.
  *
  * @return void
  */
 public function delete(Resource $resource)
 {
     $data = $resource->toArray();
     $user = $this->userManager->findUserByUsername($data['username']);
     if (!$user) {
         $errorMessage = $this->translator->trans('error.user_not_found', array('%username%' => $data['username']));
         throw new NotFoundHttpException($errorMessage);
     }
     $this->userManager->deleteUser($user);
 }
开发者ID:ingewikkeld,项目名称:rest-user-bundle,代码行数:19,代码来源:User.php

示例5: deleteFOSUser

 /**
  * Deletes an user from the FOSUser system
  * @param User $user
  */
 public function deleteFOSUser(User $user)
 {
     if ($user->getProvider()->getType() !== self::BUILTIN_PROVIDER) {
         return;
     }
     $FOSUser = $this->userManager->findUserByUsername($user->getUsername());
     if ($FOSUser !== null) {
         $this->userManager->deleteUser($FOSUser);
     }
 }
开发者ID:fulcrum3d,项目名称:PartKeepr,代码行数:14,代码来源:UserService.php

示例6: testDeleteEntity

 /**
  * {@inheritdoc}
  *
  * @dataProvider propertyAccessorProvider
  */
 public function testDeleteEntity(array $data = [])
 {
     // Instantiate User
     $user = (new User())->setUsername($data['username'])->setFullname($data['fullname'])->setEmail($data['email'])->setRoles($data['roles'])->setPassword($data['plainPassword'])->setEnabled($data['enabled']);
     foreach ($data['jobs'] as $job) {
         // Is added two times to ensure the adder handles duplications and will add it only one time
         $user->addJob($job);
         $user->addJob($job);
         $this->doctrineManager->persist($job);
     }
     $this->doctrineManager->persist($user);
     $this->doctrineManager->flush();
     // Actual test
     $this->userManager->deleteUser($user);
     foreach ($data['jobs'] as $job) {
         /* @var Job $job */
         $this->assertFalse($job->getUsers()->contains($user), 'Expected $job instance to no longer have a reference to $user.');
     }
 }
开发者ID:EllynB,项目名称:Incipio,代码行数:24,代码来源:UserTest.php

示例7: delete

 /**
  * @inheritdoc
  */
 public function delete(FOSUserInterface $user)
 {
     $this->FOSUserManager->deleteUser($user);
 }
开发者ID:viettut,项目名称:todo,代码行数:7,代码来源:LecturerManager.php

示例8: delete

 /**
  * Deletes the given user.
  *
  * @param string $username
  */
 public function delete($username)
 {
     $user = $this->findUserByUsernameOrThrowException($username);
     $this->userManager->deleteUser($user);
 }
开发者ID:Jheengut,项目名称:linuxcounter.new,代码行数:10,代码来源:UserManipulator.php

示例9: remove

 public function remove($entity)
 {
     $this->userManager->deleteUser($entity);
 }
开发者ID:Exanrus,项目名称:crm-bundle,代码行数:4,代码来源:UserManager.php


注:本文中的FOS\UserBundle\Model\UserManagerInterface::deleteUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。