protected function build($id, Request $request, Application $app) { $repo = new API2ApplicationRepository(); $this->parameters['api2Application'] = $repo->loadById($id); if (!$this->parameters['api2Application']) { $app->abort(404); } }