updateResource() public method

Updates existing resource
public updateResource ( WellCommerce\Bundle\DoctrineBundle\Entity\EntityInterface $resource, boolean $flush = true )
$resource WellCommerce\Bundle\DoctrineBundle\Entity\EntityInterface
$flush boolean
 public function resetPasswordForUser(UserInterface $user)
 {
     $password = Helper::generateRandomPassword();
     $user->setPassword($password);
     $this->manager->updateResource($user);
     $this->mailerHelper->sendEmail(['recipient' => $user->getEmail(), 'subject' => 'user.email.title.reset_password', 'template' => 'WellCommerceAdminBundle:Admin/Email:reset_password.html.twig', 'parameters' => ['user' => $user, 'password' => $password], 'configuration' => $this->shopStorage->getCurrentShop()->getMailerConfiguration()]);
 }
 /**
  * {@inheritdoc}
  */
 public function handleUpdateRequest(Request $request, $identifier)
 {
     $parameters = $request->request->all();
     $resource = $this->getResourceById($identifier);
     $className = ClassUtils::getRealClass(get_class($resource));
     $resource = $this->serializer->denormalize($parameters, $className, self::RESPONSE_FORMAT, ['resource' => $resource]);
     $data = $this->serializer->serialize($resource, self::RESPONSE_FORMAT, ['group' => $this->getResourceType()]);
     $this->manager->updateResource($resource);
     return new Response($data);
 }