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


PHP SiteModel::getId方法代碼示例

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


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

示例1: setFeature

 public function setFeature(SiteModel $site, \BaseSiteFeature $siteFeature, $value, UserAccountModel $userAccountModel = null)
 {
     try {
         $this->app['db']->beginTransaction();
         $changeMade = false;
         $stat = $this->app['db']->prepare("SELECT is_on FROM site_feature_information WHERE site_id=:site_id AND extension_id =:extension_id AND feature_id =:feature_id");
         $stat->execute(array('site_id' => $site->getId(), 'extension_id' => $siteFeature->getExtensionId(), 'feature_id' => $siteFeature->getFeatureId()));
         if ($stat->rowCount() == 1) {
             $data = $stat->fetch();
             if ($data['is_on'] != $value) {
                 $stat = $this->app['db']->prepare("UPDATE site_feature_information SET  is_on=:is_on " . " WHERE site_id=:site_id AND extension_id =:extension_id AND feature_id =:feature_id ");
                 $stat->execute(array('site_id' => $site->getId(), 'extension_id' => $siteFeature->getExtensionId(), 'feature_id' => $siteFeature->getFeatureId(), 'is_on' => $value ? 1 : 0));
                 $changeMade = true;
             }
         } else {
             $stat = $this->app['db']->prepare("INSERT INTO site_feature_information (site_id, extension_id, feature_id, is_on) " . " VALUES(:site_id, :extension_id, :feature_id, :is_on) ");
             $stat->execute(array('site_id' => $site->getId(), 'extension_id' => $siteFeature->getExtensionId(), 'feature_id' => $siteFeature->getFeatureId(), 'is_on' => $value ? 1 : 0));
             $changeMade = true;
         }
         if ($changeMade) {
             $stat = $this->app['db']->prepare("INSERT INTO site_feature_history (site_id, extension_id, feature_id, is_on, user_account_id, created_at) " . " VALUES (:site_id, :extension_id, :feature_id, :is_on, :user_account_id, :created_at)");
             $stat->execute(array('site_id' => $site->getId(), 'extension_id' => $siteFeature->getExtensionId(), 'feature_id' => $siteFeature->getFeatureId(), 'is_on' => $value ? 1 : 0, 'user_account_id' => $userAccountModel ? $userAccountModel->getId() : null, 'created_at' => \TimeSource::getFormattedForDataBase()));
         }
         $this->app['db']->commit();
     } catch (Exception $e) {
         $this->app['db']->rollBack();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:28,代碼來源:SiteFeatureRepository.php

示例2: build

 protected function build()
 {
     $this->select[] = 'area_information.*';
     if ($this->site) {
         $this->where[] = " area_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->country) {
         $this->where[] = " area_information.country_id = :country_id ";
         $this->params['country_id'] = $this->country->getId();
     }
     if (!$this->include_deleted) {
         $this->where[] = " area_information.is_deleted = '0' ";
     }
     if ($this->noParentArea) {
         $this->where[] = ' area_information.parent_area_id IS null ';
     } else {
         if ($this->parentArea) {
             $this->where[] = " area_information.parent_area_id = :parent_id ";
             $this->params['parent_id'] = $this->parentArea->getId();
         }
     }
     if ($this->cacheNeedsBuildingOnly) {
         $this->where[] = " area_information.cache_area_has_parent_generated = '0'";
     }
     if ($this->freeTextSearch) {
         $this->where[] = ' area_information.title ILIKE :free_text_search ';
         $this->params['free_text_search'] = "%" . strtolower($this->freeTextSearch) . "%";
     }
     if ($this->include_parent_levels > 0) {
         $this->joins[] = " LEFT JOIN area_information AS area_information_parent_1 ON area_information.parent_area_id = area_information_parent_1.id ";
         $this->select[] = " area_information_parent_1.title AS parent_1_title";
     }
 }
開發者ID:schlos,項目名稱:MeetYourNextMP-Web-Core,代碼行數:34,代碼來源:AreaRepositoryBuilder.php

示例3: build

 protected function build()
 {
     if ($this->site) {
         $this->where[] = " incoming_link.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:7,代碼來源:IncomingLinkRepositoryBuilder.php

示例4: build

 protected function build()
 {
     if ($this->site) {
         $this->where[] = " human_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->humansForEvent) {
         $this->joins[] = "  JOIN event_has_human ON event_has_human.human_id = human_information.id AND  event_has_human.event_id = :event_id AND event_has_human.removed_at IS NULL";
         $this->params['event_id'] = $this->humansForEvent->getId();
     } else {
         if ($this->humansNotForEvent) {
             $this->joins[] = " LEFT JOIN event_has_human ON event_has_human.human_id = human_information.id AND  event_has_human.event_id = :event_id AND event_has_human.removed_at IS NULL";
             $this->params['event_id'] = $this->humansNotForEvent->getId();
             $this->where[] = ' event_has_human.event_id IS NULL ';
         }
     }
     if ($this->area) {
         // TODO direct areas only, should do child areas to. But not now.
         $this->joins[] = "  JOIN human_in_area ON human_in_area.human_id = human_information.id AND  human_in_area.area_id = :area_id AND human_in_area.removed_at IS NULL";
         $this->params['area_id'] = $this->area->getId();
     }
     if (!$this->include_deleted) {
         $this->where[] = " human_information.is_deleted = '0' ";
     }
     if ($this->freeTextSearch) {
         $this->where[] = '(CASE WHEN human_information.title IS NULL THEN \'\' ELSE human_information.title END )  || \' \' || ' . '(CASE WHEN human_information.description IS NULL THEN \'\' ELSE human_information.description END )' . ' ILIKE :free_text_search ';
         $this->params['free_text_search'] = "%" . strtolower($this->freeTextSearch) . "%";
     }
 }
開發者ID:schlos,項目名稱:MeetYourNextMP-Web-Core,代碼行數:29,代碼來源:HumanRepositoryBuilder.php

示例5: build

 protected function build()
 {
     $this->select = array('group_information.*');
     if ($this->site) {
         $this->where[] = " group_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->event) {
         $this->joins[] = " JOIN event_in_group AS event_in_group ON event_in_group.group_id = group_information.id " . "AND event_in_group.removed_at IS NULL AND event_in_group.event_id = :event_id ";
         $this->params['event_id'] = $this->event->getId();
     } else {
         if ($this->notEvent) {
             $this->joins[] = " LEFT JOIN event_in_group AS event_in_group ON event_in_group.group_id = group_information.id " . "AND event_in_group.removed_at IS NULL AND event_in_group.event_id = :event_id ";
             $this->params['event_id'] = $this->notEvent->getId();
             $this->where[] = '  event_in_group.event_id IS NULL ';
         }
     }
     if ($this->freeTextSearch) {
         $this->where[] = '(CASE WHEN group_information.title IS NULL THEN \'\' ELSE group_information.title END )  || \' \' || ' . '(CASE WHEN group_information.description IS NULL THEN \'\' ELSE group_information.description END )' . ' ILIKE :free_text_search ';
         $this->params['free_text_search'] = "%" . strtolower($this->freeTextSearch) . "%";
     }
     if (!$this->include_deleted) {
         $this->where[] = " group_information.is_deleted = '0' ";
     }
     if ($this->includeMediasSlugs) {
         $this->select[] = "  (SELECT  array_to_string(array_agg(media_information.slug), ',') FROM media_information " . " JOIN media_in_group ON media_information.id = media_in_group.media_id " . " WHERE media_information.deleted_at IS NULL AND media_information.is_file_lost='0' " . " AND media_in_group.removal_approved_at IS NULL AND media_in_group.group_id = group_information.id " . " GROUP BY group_information.id ) AS media_group_slugs ";
     }
     if ($this->editedByUser) {
         $this->where[] = " group_information.id IN (SELECT group_id FROM group_history WHERE user_account_id = :editedByUser) ";
         $this->params['editedByUser'] = $this->editedByUser->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:32,代碼來源:GroupRepositoryBuilder.php

示例6: build

 protected function build()
 {
     $this->select[] = 'event_custom_field_definition_information.*';
     if ($this->site) {
         $this->where[] = " event_custom_field_definition_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:8,代碼來源:EventCustomFieldDefinitionRepositoryBuilder.php

示例7: build

 protected function build()
 {
     $this->select = array('new_event_draft_information.*');
     if ($this->site) {
         $this->where[] = " new_event_draft_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:8,代碼來源:NewEventDraftRepositoryBuilder.php

示例8: build

 protected function build()
 {
     if ($this->onlyCurrent) {
         $this->where[] = "user_watches_site_information.is_watching = '1'";
     }
     if ($this->site) {
         $this->where[] = " user_watches_site_information.site_id = :site_id";
         $this->params['site_id'] = $this->site->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:10,代碼來源:UserWatchesSiteRepositoryBuilder.php

示例9: build

 protected function build()
 {
     if ($this->site) {
         $this->where[] = " send_email_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->userCreatedBy) {
         $this->where[] = " send_email_information.created_by = :created_by ";
         $this->params['created_by'] = $this->userCreatedBy->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:11,代碼來源:SendEmailRepositoryBuilder.php

示例10: build

 protected function build()
 {
     if ($this->site) {
         $this->where[] = " import_url_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->group) {
         $this->where[] = " import_url_information.group_id = :group_id ";
         $this->params['group_id'] = $this->group->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:11,代碼來源:ImportURLRepositoryBuilder.php

示例11: build

 protected function build()
 {
     global $DB;
     if ($this->site) {
         $this->joins[] = " JOIN user_group_in_site ON user_group_in_site.user_group_id = user_group_information.id " . " AND user_group_in_site.site_id = :site_id AND user_group_in_site.removed_at IS NULL";
         $this->params['site_id'] = $this->site->getId();
     }
     if (!$this->include_deleted) {
         $this->where[] = " user_group_information.is_deleted = '0' ";
     }
     if ($this->index_only) {
         $this->where[] = " user_group_information.is_in_index = '1' ";
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:14,代碼來源:UserGroupRepositoryBuilder.php

示例12: build

 protected function build()
 {
     $this->joins[] = " LEFT JOIN site_information ON site_information.id = user_notification.site_id  ";
     if ($this->site) {
         $this->where[] = " user_notification.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->user) {
         $this->where[] = " user_notification.user_id = :user_id ";
         $this->params['user_id'] = $this->user->getId();
     }
     if ($this->isOpenBySysAdminsOnly) {
         $this->where[] = "   ( site_information.is_closed_by_sys_admin = '0' OR site_information.is_closed_by_sys_admin is null ) ";
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:15,代碼來源:UserNotificationRepositoryBuilder.php

示例13: isCountryInSite

 public function isCountryInSite(CountryModel $country, SiteModel $site)
 {
     global $DB;
     $stat = $DB->prepare("SELECT * FROM country_in_site_information WHERE site_id =:site_id AND country_id =:country_id AND is_in= '1'");
     $stat->execute(array('country_id' => $country->getId(), 'site_id' => $site->getId()));
     return $stat->rowCount() == 1;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:7,代碼來源:CountryInSiteRepository.php

示例14: build

 protected function build()
 {
     $this->select[] = 'country.*';
     if ($this->site && $this->siteInformation) {
         $this->joins[] = " LEFT JOIN country_in_site_information ON country_in_site_information.country_id = country.id AND country_in_site_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
         $this->select[] = "  country_in_site_information.is_in AS site_is_in ";
     } else {
         if ($this->site && $this->siteIn) {
             $this->joins[] = " JOIN country_in_site_information ON country_in_site_information.country_id = country.id ";
             $this->where[] = " country_in_site_information.site_id = :site_id";
             $this->where[] = " country_in_site_information.is_in = '1'";
             $this->params['site_id'] = $this->site->getId();
         }
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:16,代碼來源:CountryRepositoryBuilder.php

示例15: isUserInSite

 public function isUserInSite(UserAccountModel $userAccountModel, SiteModel $siteModel)
 {
     global $DB;
     $stat = $DB->prepare("SELECT * FROM user_has_no_editor_permissions_in_site WHERE site_id=:site_id AND user_account_id=:user_account_id AND removed_at IS NULL");
     $stat->execute(array("site_id" => $siteModel->getId(), "user_account_id" => $userAccountModel->getId()));
     return $stat->rowCount() > 0;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:7,代碼來源:UserHasNoEditorPermissionsInSiteRepository.php


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