function json(Request $request, Application $app) { $ourRequest = new \Request($request); $json = new EventListJSONBuilder($app['currentSite'], $app['currentTimeZone']); $json->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false)); $json->build(); return $json->getResponse(); }
function json($username, Request $request, Application $app) { if (!$this->build($username, $request, $app)) { $app->abort(404, "User does not exist."); } $json = new EventListJSONBuilder(null, $app['currentTimeZone']); $json->getEventRepositoryBuilder()->setUserAccount($this->parameters['user'], false, false, true, false); $json->build(); return $json->getResponse(); }
function json($slug, Request $request, Application $app) { $ourRequest = new \Request($request); if (!$this->build($slug, $request, $app)) { $app->abort(404, "curatedlist does not exist."); } $json = new EventListJSONBuilder($app['currentSite'], $app['currentTimeZone']); $json->getEventRepositoryBuilder()->setCuratedList($this->parameters['curatedlist']); $json->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false)); $json->build(); return $json->getResponse(); }
function json($slug, Request $request, Application $app) { if (!$this->build($slug, $request, $app)) { $app->abort(404, "Event does not exist."); } $eventMedias = array(); $ourRequest = new \Request($request); if ($ourRequest->getGetOrPostBoolean("includeMedias", false)) { $mrb = new MediaRepositoryBuilder(); $mrb->setEvent($this->parameters['event']); $mrb->setIncludeDeleted(false); $eventMedias = $mrb->fetchAll(); } $json = new EventListJSONBuilder($app['currentSite'], $app['currentTimeZone']); $json->addEvent($this->parameters['event'], $this->parameters['groups'], $this->parameters['venue'], $this->parameters['area'], $this->parameters['country'], $eventMedias); return $json->getResponse(); }