Ojs\ApiBundle\Controller\Admin\ContactTypesRestController::getOr404 PHP Method

getOr404() protected method

Fetch a Contact Type or throw an 404 Exception.
protected getOr404 ( mixed $id ) : Ojs\ApiBundle\Model\ContactTypesInterface
$id mixed
return Ojs\ApiBundle\Model\ContactTypesInterface
    protected function getOr404($id)
    {
        if (!($contactType = $this->container->get('ojs_api.contact_type.handler')->get($id))) {
            throw new NotFoundHttpException(sprintf('The resource \'%s\' was not found.', $id));
        }
        return $contactType;
    }