function index(Application $app) { $params = new EventFilterParams(); $params->set($_GET); $params->getEventRepositoryBuilder()->setSite($app['currentSite']); $params->getEventRepositoryBuilder()->setIncludeAreaInformation(true); $params->getEventRepositoryBuilder()->setIncludeVenueInformation(true); $params->getEventRepositoryBuilder()->setIncludeMediasSlugs(true); if ($app['currentUser']) { $params->getEventRepositoryBuilder()->setUserAccount($app['currentUser'], true); } $events = $params->getEventRepositoryBuilder()->fetchAll(); return $app['twig']->render('site/eventlist/index.html.twig', array('eventListFilterParams' => $params, 'events' => $events)); }
function agenda(Request $request, Application $app) { $params = new EventFilterParams(); $params->setSpecifiedUserControls(true, $app['currentUser'], true); $params->getEventRepositoryBuilder()->setIncludeAreaInformation(true); $params->getEventRepositoryBuilder()->setIncludeVenueInformation(true); $params->getEventRepositoryBuilder()->setIncludeMediasSlugs(true); $params->set($_GET); $events = $params->getEventRepositoryBuilder()->fetchAll(); return $app['twig']->render('index/currentuser/agenda.html.twig', array('eventListFilterParams' => $params, 'events' => $events)); }