protected function getOr404($id) { if (!($entity = $this->container->get('ojs_api.journal_section.handler')->get($id))) { throw new NotFoundHttpException(sprintf('The resource \'%s\' was not found.', $id)); } return $entity; }