Sonata\CustomerBundle\Controller\Api\CustomerController::getCustomer PHP Method

getCustomer() protected method

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