Controller/Order/DefaultController.php
public function mark_as_ready_to_pickupAction(Order $order)
    {
        $order->markReadyForPickupFromHub();

        $message = \Swift_Message::newInstance()
            ->setSubject('Your order is ready to be picked up')
            ->setFrom(array('no-reply@harvestcloud.com' => 'Harvest Cloud'))
            ->setTo(array('tom@templestreetmedia.com' => 'Tom Haskins-Vaughan'))
            ->setBody($this->renderView(
                'HarvestCloudEmailBundle:Buyer:order_ready_to_pickup.txt.twig', array(
                    'order' => $order
            )))
        ;

        $this->get('mailer')->send($message);

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
public function mark_as_ready_to_pickupAction(Order $order)
    {
        $order->markReadyForPickupFromHub();

        $message = \Swift_Message::newInstance()
            ->setSubject('Your order is ready to be picked up')
            ->setFrom(array('no-reply@harvestcloud.com' => 'Harvest Cloud'))
            ->setTo(array('tom@templestreetmedia.com' => 'Tom Haskins-Vaughan'))
            ->setBody($this->renderView(
                'HarvestCloudEmailBundle:Buyer:order_ready_to_pickup.txt.twig', array(
                    'order' => $order
            )))
        ;

        $this->get('mailer')->send($message);

        $em = $this->getDoctrine()->getEntityManager();
        $em->persist($order);
        $em->flush();

        return $this->redirect($this->generateUrl('Order_show', array(
            'id' => $order->getNumberForPath()
        )));
    }
public function mark_as_ready_to_pickupAction ( Order $ order ) { $ order -> markReadyForPickupFromHub ( ) ; $ message = \ Swift_Message :: newInstance ( ) -> setSubject ( 'Your order is ready to be picked up' ) -> setFrom ( array ( 'no-reply@harvestcloud.com' => 'Harvest Cloud' ) ) -> setTo ( array ( 'tom@templestreetmedia.com' => 'Tom Haskins-Vaughan' ) ) -> setBody ( $ this -> renderView ( 'HarvestCloudEmailBundle:Buyer:order_ready_to_pickup.txt.twig' , array ( 'order' => $ order ) ) ) ; $ this -> get ( 'mailer' ) -> send ( $ message ) ; $ em = $ this -> getDoctrine ( ) -> getEntityManager ( ) ; $ em -> persist ( $ order ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'Order_show' , array ( 'id' => $ order -> getNumberForPath ( ) ) ) ) ; }
mark as ready to pickup

@author Tom Haskins-Vaughan <tom@harvestcloud.com>
@since  2012-05-15

@Route("/{id}/mark-as-ready-to-pickup")
@ParamConverter("order", class="HarvestCloudCoreBundle:Order")

@param  Order  $order
mark as ready to pickup