Exemplo n.º 1
0
 /**
  * Add fees
  * @param \AppBundle\Entity\AccommodationFee $fees
  * @return Accommodation
  */
 public function addFee(\AppBundle\Entity\AccommodationFee $fees)
 {
     $this->fees[] = $fees;
     $fees->setAccommodation($this);
     return $this;
 }
Exemplo n.º 2
0
 /**
  * Activate fee
  * @param AccommodationFee $fee
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function feeActivateAction(Request $request, AccommodationFee $fee)
 {
     $em = $this->getDoctrine()->getManager();
     # Unactivate all of existing fees for this accommodation
     $em->getRepository('AppBundle:AccommodationFee')->changeStatus($fee->getAccommodation(), 0);
     $fee->setStatus(1);
     $em->persist($fee);
     $em->flush();
     $session = $request->getSession();
     $session->getFlashBag()->add('msgSuccess', $this->get('translator')->trans('change_status_success'));
     $this->approveAccommodationEmail($fee->getAccommodation());
     return $this->redirect($this->generateUrl('admin_accommodation_fees', array('id' => $fee->getAccommodation()->getId())));
 }