protected function build($id, Request $request, Application $app) { $this->parameters = array('currentUserWatchesGroup' => false); $ugr = new UserGroupRepository(); $this->parameters['usergroup'] = $ugr->loadByIdInSite($id, $app['currentSite']); if (!$this->parameters['usergroup']) { return false; } return true; }
protected function build($siteid, $id, Request $request, Application $app) { $this->parameters = array(); $sr = new SiteRepository(); $this->parameters['site'] = $sr->loadById($siteid); if (!$this->parameters['site']) { $app->abort(404); } $sr = new UserGroupRepository(); $this->parameters['usergroup'] = $sr->loadByIdInSite($id, $this->parameters['site']); if (!$this->parameters['usergroup']) { $app->abort(404); } }