コード例 #1
0
 /**
  * @param $id
  * @return Response|\Illuminate\View\View
  */
 public function viewAction($id)
 {
     $invoice = $this->invoiceRepository->getById($id);
     if (!$invoice) {
         return new Response('', 404);
     }
     return view('invoices/view', ['invoice' => $invoice, 'order' => $invoice->getOrder()]);
 }
コード例 #2
0
 /**
  * @return array|null
  */
 public function viewAction()
 {
     $id = $this->params()->fromRoute('id');
     $invoice = $this->invoices->getById($id);
     if (!$invoice) {
         $this->getResponse()->setStatusCode(404);
         return null;
     }
     return ['invoice' => $invoice, 'order' => $invoice->getOrder()];
 }