Пример #1
0
 public function addMemo(User $user, ShippingOption $shippingOption)
 {
     $now = new \DateTime();
     $memo = "{$user->getUsername()}於{$now->format('Y-m-d')}修改運費為{$shippingOption->getDescription()}";
     $this->memo = "{$this->memo}{$memo}<br>";
     return $this;
 }
Пример #2
0
 /**
  * @Route("/{id}/edit", requirements={"id"="\d+"}, name="admin_user_update")
  * @ParamConverter("user", class="WoojinUserBundle:User")
  * @Method("PUT")
  */
 public function updateAction(Request $request, User $user)
 {
     $em = $this->getDoctrine()->getManager();
     $user->setStore($em->find('WoojinStoreBundle:Store', $request->request->get('store')))->setRole($em->find('WoojinUserBundle:Role', $request->request->get('role')))->setUsername($request->request->get('username', $user->getUsername()))->setEmail($request->request->get('email', $user->getEmail()))->setMobil($request->request->get('mobil', $user->getMobil()))->setIsActive((int) $request->request->get('is_active') === 1);
     $em->persist($user);
     $em->flush();
     $session = $this->get('session');
     $session->getFlashBag()->add('success', $user->getUsername() . '修改完成');
     return $this->redirect($this->generateUrl('admin_role_index'));
 }
Пример #3
0
 public function attachUpdatePaidAtMemo(User $updater, \DateTime $paidAt)
 {
     $now = new \DateTime();
     $attach = "原付款時間{$this->getPaidAt()->format('Y-m-d')},{$updater->getUsername()}於{$now->format('Y-m-d')}更新為{$paidAt->format('Y-m-d')}";
     $this->memo = "{$this->memo}{$attach}<br>";
     return $this;
 }
Пример #4
0
 protected function attachSoldAtUpdateMemo(\DateTime $newDate, User $user)
 {
     $date = new \DateTime();
     return "原售出時間:{$this->getSoldAtString()},由{$user->getUsername()}於{$date->format('Y-m-d H:i:s')}更新為{$newDate->format('Y-m-d H:i:s')}<br/>";
 }