Sonata\CustomerBundle\Controller\Api\AddressController::getAddress PHP Method

getAddress() protected method

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