當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SiteRepository::loadById方法代碼示例

本文整理匯總了PHP中Repositories\SiteRepository::loadById方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteRepository::loadById方法的具體用法?PHP SiteRepository::loadById怎麽用?PHP SiteRepository::loadById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Repositories\SiteRepository的用法示例。


在下文中一共展示了SiteRepository::loadById方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: build

 protected function build($siteid, $slug, Request $request, Application $app)
 {
     $this->parameters = array('user' => null, 'eventCreated' => null, 'eventDupe' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $repo = new NewEventDraftRepository();
     $this->parameters['draft'] = $repo->loadBySlugForSite($slug, $this->parameters['site']);
     if (!$this->parameters['draft']) {
         $app->abort(404);
     }
     if ($this->parameters['draft']->getUserAccountId()) {
         $ur = new UserAccountRepository();
         $this->parameters['user'] = $ur->loadByID($this->parameters['draft']->getUserAccountId());
     }
     if ($this->parameters['draft']->getEventId()) {
         $er = new EventRepository();
         $this->parameters['eventCreated'] = $er->loadByID($this->parameters['draft']->getEventId());
     }
     if ($this->parameters['draft']->getWasExistingEventId()) {
         $er = new EventRepository();
         $this->parameters['eventDupe'] = $er->loadByID($this->parameters['draft']->getWasExistingEventId());
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:26,代碼來源:NewEventDraftController.php

示例2: build

 protected function build($siteid, $slug, Request $request, Application $app)
 {
     $this->parameters = array('group' => null, 'venue' => null, 'country' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $er = new EventRepository();
     $this->parameters['event'] = $er->loadBySlug($this->parameters['site'], $slug);
     $this->parameters['eventisduplicateof'] = $this->parameters['event']->getIsDuplicateOfId() ? $er->loadById($this->parameters['event']->getIsDuplicateOfId()) : null;
     if (!$this->parameters['event']) {
         $app->abort(404);
     }
     if ($this->parameters['event']->getGroupId()) {
         $gr = new GroupRepository();
         $this->parameters['group'] = $gr->loadById($this->parameters['event']->getGroupId());
     }
     if ($this->parameters['event']->getCountryID()) {
         $cr = new CountryRepository();
         $this->parameters['country'] = $cr->loadById($this->parameters['event']->getCountryID());
     }
     if ($this->parameters['event']->getVenueID()) {
         $cr = new VenueRepository();
         $this->parameters['venue'] = $cr->loadById($this->parameters['event']->getVenueID());
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:27,代碼來源:EventController.php

示例3: build

 protected function build($id, Request $request, Application $app)
 {
     $this->parameters = array('group' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($id);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
 }
開發者ID:schlos,項目名稱:MeetYourNextMP-Web-Core,代碼行數:9,代碼來源:SiteController.php

示例4: listForSite

 function listForSite($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $nedrb = new NewEventDraftRepositoryBuilder();
     $nedrb->setSite($site);
     $drafts = $nedrb->fetchAll();
     return $app['twig']->render('sysadmin/neweventdraftlist/index.html.twig', array('site' => $site, 'neweventdrafts' => $drafts));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:12,代碼來源:NewEventDraftListController.php

示例5: listForSite

 function listForSite($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $ilrb = new IncomingLinkRepositoryBuilder();
     $ilrb->setSite($site);
     $incominglinks = $ilrb->fetchAll();
     return $app['twig']->render('sysadmin/incominglinklist/forSite.html.twig', array('site' => $site, 'incominglinks' => $incominglinks));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:12,代碼來源:IncomingLinkListController.php

示例6: index

 function index($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $grb = new GroupRepositoryBuilder();
     $grb->setSite($site);
     $groups = $grb->fetchAll();
     return $app['twig']->render('sysadmin/grouplist/index.html.twig', array('site' => $site, 'groups' => $groups));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:12,代碼來源:GroupListController.php

示例7: index

 function index($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $rb = new CuratedListRepositoryBuilder();
     $rb->setSite($site);
     $curatedlists = $rb->fetchAll();
     return $app['twig']->render('sysadmin/curatedlistlist/index.html.twig', array('site' => $site, 'curatedlists' => $curatedlists));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:12,代碼來源:CuratedListListController.php

示例8: index

 function index($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $mrb = new MediaRepositoryBuilder();
     $mrb->setIncludeDeleted(true);
     $mrb->setSite($site);
     $medias = $mrb->fetchAll();
     return $app['twig']->render('sysadmin/medialist/index.html.twig', array('site' => $site, 'medias' => $medias));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:13,代碼來源:MediaListController.php

示例9: index

 function index($siteid, Request $request, Application $app)
 {
     $sr = new SiteRepository();
     $site = $sr->loadById($siteid);
     if (!$site) {
         die("404");
     }
     $erb = new EventRepositoryBuilder();
     $erb->setSite($site);
     $erb->setOrderByStartAt(true);
     $events = $erb->fetchAll();
     return $app['twig']->render('sysadmin/eventlist/index.html.twig', array('site' => $site, 'events' => $events));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:13,代碼來源:EventListController.php

示例10: build

 protected function build($siteid, $fieldid, Request $request, Application $app)
 {
     $this->parameters = array();
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $repo = new EventCustomFieldDefinitionRepository();
     $this->parameters['field'] = $repo->loadBySiteIDAndID($this->parameters['site']->getId(), $fieldid);
     if (!$this->parameters['field']) {
         $app->abort(404);
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:14,代碼來源:EventCustomFieldDefinitionController.php

示例11: build

 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);
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:14,代碼來源:SiteUserGroupController.php

示例12: build

 protected function build($siteid, $slug, Request $request, Application $app)
 {
     $this->parameters = array('group' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $clr = new CuratedListRepository();
     $this->parameters['curatedlist'] = $clr->loadBySlug($this->parameters['site'], $slug);
     if (!$this->parameters['curatedlist']) {
         $app->abort(404);
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:14,代碼來源:CuratedListController.php

示例13: build

 protected function build($siteid, $slug, Request $request, Application $app)
 {
     $this->parameters = array('group' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $vr = new VenueRepository();
     $this->parameters['venue'] = $vr->loadBySlug($this->parameters['site'], $slug);
     if (!$this->parameters['venue']) {
         $app->abort(404);
     }
     $this->parameters['venueisduplicateof'] = $this->parameters['venue']->getIsDuplicateOfId() ? $vr->loadById($this->parameters['venue']->getIsDuplicateOfId()) : null;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:15,代碼來源:VenueController.php

示例14: build

 protected function build($siteid, $slug, Request $request, Application $app)
 {
     $this->parameters = array('area' => null, 'parentarea' => null);
     $sr = new SiteRepository();
     $this->parameters['site'] = $sr->loadById($siteid);
     if (!$this->parameters['site']) {
         $app->abort(404);
     }
     $ar = new AreaRepository();
     $this->parameters['area'] = $ar->loadBySlug($this->parameters['site'], $slug);
     if (!$this->parameters['area']) {
         $app->abort(404);
     }
     $this->parameters['areaisduplicateof'] = $this->parameters['area']->getIsDuplicateOfId() ? $ar->loadById($this->parameters['area']->getIsDuplicateOfId()) : null;
     if ($this->parameters['area']->getParentAreaId()) {
         $this->parameters['parentarea'] = $ar->loadById($this->parameters['area']->getParentAreaId());
     }
     $cr = new CountryRepository();
     $this->parameters['country'] = $this->parameters['area']->getCountryId() ? $cr->loadById($this->parameters['area']->getCountryId()) : null;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:20,代碼來源:AreaController.php

示例15: SiteRepository

 function __construct(ImportURLModel $importURL, SiteModel $site = null)
 {
     $this->importURL = $importURL;
     $this->realurl = $importURL->getUrl();
     if ($site) {
         $this->site = $site;
     } else {
         $siteRepo = new SiteRepository();
         $this->site = $siteRepo->loadById($importURL->getSiteId());
     }
     if ($importURL->getCountryId()) {
         $countryRepo = new CountryRepository();
         $this->country = $countryRepo->loadById($importURL->getCountryId());
     }
     if ($importURL->getAreaId()) {
         $areaRepo = new AreaRepository();
         $this->area = $areaRepo->loadById($importURL->getAreaId());
     }
     $groupRepository = new GroupRepository();
     $this->group = $groupRepository->loadById($importURL->getGroupId());
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:21,代碼來源:ImportURLRun.php


注:本文中的Repositories\SiteRepository::loadById方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。