コード例 #1
0
ファイル: PasswordEncoder.php プロジェクト: khelle/EngiShop
 public function encodePassword(User $user, $plainPassword = null)
 {
     if (!$plainPassword) {
         $plainPassword = $user->getPassword();
     }
     return $this->encoderFactory->getEncoder($user)->encodePassword($plainPassword, $user->getSalt());
 }
コード例 #2
0
 /**
  * @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]);
 }
コード例 #3
0
ファイル: Cart.php プロジェクト: khelle/EngiShop
 /**
  * @param User $user
  * @return $this
  */
 public function setUser(User $user)
 {
     $this->user = $user;
     $user->setCart($this);
     return $this;
 }
コード例 #4
0
 /**
  * @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');
 }
コード例 #5
0
ファイル: OrderClass.php プロジェクト: khelle/EngiShop
 /**
  * @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;
 }