Sonata\InvoiceBundle\Controller\Api\InvoiceController::getInvoice PHP Method

getInvoice() protected method

Retrieves invoice with id $id or throws an exception if it doesn't exist.
protected getInvoice ( $id ) : Sonata\Component\Invoice\InvoiceInterface
$id
return Sonata\Component\Invoice\InvoiceInterface
    protected function getInvoice($id)
    {
        $invoice = $this->invoiceManager->findOneBy(array('id' => $id));
        if (null === $invoice) {
            throw new NotFoundHttpException(sprintf('Invoice (%d) not found', $id));
        }
        return $invoice;
    }