Ejemplo n.º 1
0
 /**
  * @Route("/{id}", requirements={"id"="\d+"}, name="admin_benefitRule_delete")
  * @ParamConverter("rule", class="WoojinOrderBundle:BenefitRule")
  * @Method("DELETE")
  */
 public function destroyAction(Request $request, BenefitRule $rule)
 {
     $eventId = $rule->getEvent()->getId();
     $em = $this->getDoctrine()->getManager();
     $em->remove($rule);
     $em->flush();
     $session = $this->get('session');
     // set flash messages
     $session->getFlashBag()->add('success', '刪除規則完成!');
     return $this->redirect($this->generateUrl('benefitevent_edit', array('id' => $eventId, 'isRule' => true)));
 }
Ejemplo n.º 2
0
 /**
  * 不可累計的折扣購物金金額
  * 
  * @return integer
  */
 protected function nonStockPredict(Orders $order, BenefitRule $rule)
 {
     return $rule->getGift();
 }