本文整理汇总了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());
}
}
示例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());
}
}
示例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);
}
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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());
}