public function encodePassword(User $user, $plainPassword = null) { if (!$plainPassword) { $plainPassword = $user->getPassword(); } return $this->encoderFactory->getEncoder($user)->encodePassword($plainPassword, $user->getSalt()); }
/** * @param OrderClass $order * @param User $user * @return \Symfony\Component\HttpFoundation\RedirectResponse * * @ParamConverter("user", class="EngiShopBundle:User", isOptional="true", options={"mapping": {"user": "******"}}) */ public function deleteAction(OrderClass $order, User $user = null) { if ($order->isInProcess()) { throw new AccessDeniedException(); } $this->getEm()->remove($order); $this->getEm()->flush(); return $this->redirectToRoute('engishop_admin_order', ['user' => $user ? $user->getId() : null]); }
/** * @param User $user * @return $this */ public function setUser(User $user) { $this->user = $user; $user->setCart($this); return $this; }
/** * @param User $user * @return \Symfony\Component\HttpFoundation\RedirectResponse */ public function toggleAction(User $user) { $user->setIsActive(!$user->getIsActive()); $this->getEm()->flush(); return $this->redirectToRoute('engishop_admin_user'); }
/** * @param User $user * @return OrderClass */ public function setUser(User $user) { $this->user = $user; $this->setFirstName($user->getFirstName())->setLastName($user->getLastName())->setAddress($user->getAddress())->setAddress2($user->getAddress2())->setZip($user->getZip())->setCity($user->getCity())->setState($user->getState())->setCountry($user->getCountry()); $user->addOrder($this); return $this; }