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


PHP UserAccountModel::getId方法代碼示例

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


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

示例1: build

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

示例2: build

 protected function build()
 {
     if ($this->userInterestedIn) {
         $this->params['user_in_site'] = $this->userInterestedIn->getId();
         // user watches site
         $this->joins[] = " LEFT JOIN user_watches_site_information ON user_watches_site_information.site_id = site_information.id AND user_watches_site_information.user_account_id = :user_in_site ";
         // user interested in site
         $this->joins[] = " LEFT JOIN user_interested_in_site_information ON user_interested_in_site_information.site_id = site_information.id AND user_interested_in_site_information.user_account_id = :user_in_site ";
         // user watches group information
         $inner = "SELECT  group_information.site_id AS site_id, user_watches_group_information.user_account_id AS user_account_id " . "FROM user_watches_group_information " . " JOIN group_information ON group_information.id = user_watches_group_information.group_id " . " WHERE user_watches_group_information.is_watching = '1' AND user_watches_group_information.user_account_id = :user_in_site " . " GROUP BY group_information.site_id, user_watches_group_information.user_account_id ";
         $this->joins[] = " LEFT JOIN (" . $inner . ") AS user_watches_group ON user_watches_group.site_id = site_information.id  ";
         // user watches area information
         $inner = "SELECT  area_information.site_id AS site_id, user_watches_area_information.user_account_id AS user_account_id " . "FROM user_watches_area_information " . " JOIN area_information ON area_information.id = user_watches_area_information.area_id " . " WHERE user_watches_area_information.is_watching = '1' AND user_watches_area_information.user_account_id = :user_in_site " . " GROUP BY area_information.site_id, user_watches_area_information.user_account_id ";
         $this->joins[] = " LEFT JOIN (" . $inner . ") AS user_watches_area ON user_watches_area.site_id = site_information.id  ";
         // TODO user at event. https://github.com/OpenACalendar/OpenACalendar-Web-Core/issues/357
         // Permissions
         $inner = "SELECT user_group_in_site.site_id AS site_id, user_in_user_group.user_account_id AS user_account_id FROM user_group_in_site " . "LEFT JOIN user_in_user_group ON user_in_user_group.user_group_id = user_group_in_site.user_group_id " . "WHERE user_group_in_site.removed_at IS NULL AND user_in_user_group.removed_at IS NULL AND user_in_user_group.user_account_id = :user_in_site " . "GROUP BY user_group_in_site.site_id, user_in_user_group.user_account_id ";
         $this->joins[] = " LEFT JOIN (" . $inner . ") AS user_permission_in_site ON user_permission_in_site.site_id = site_information.id  ";
         // put it all together
         $this->where[] = " (  user_watches_site_information.is_watching = '1' " . " OR user_permission_in_site.user_account_id = :user_in_site " . " OR user_watches_group.user_account_id = :user_in_site " . " OR user_watches_area.user_account_id = :user_in_site " . " OR user_interested_in_site_information.is_interested = '1' " . " )";
     }
     if ($this->isListedInIndexOnly) {
         $this->where[] = " site_information.is_listed_in_index = '1' ";
     }
     if ($this->isOpenBySysAdminsOnly) {
         $this->where[] = "  site_information.is_closed_by_sys_admin = '0' ";
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:28,代碼來源:SiteRepositoryBuilder.php

示例3: build

 protected function build()
 {
     $this->select[] = 'sysadmin_comment_information.*';
     if ($this->user) {
         $this->joins[] = "  JOIN sysadmin_comment_about_user ON sysadmin_comment_about_user.sysadmin_comment_id = sysadmin_comment_information.id  ";
         $this->where[] = " sysadmin_comment_about_user.user_account_id = :user_account_id ";
         $this->params['user_account_id'] = $this->user->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:9,代碼來源:SysadminCommentRepositoryBuilder.php

示例4: 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

示例5: editEmailPreference

 public function editEmailPreference(UserAccountModel $user, $extensionId, $userNotificationPreferenceType, $value)
 {
     global $DB;
     # is already in DB?
     $stat = $DB->prepare("SELECT user_notification_preference.* FROM user_notification_preference " . "WHERE user_id =:user_id AND extension_id=:extension_id AND user_notification_preference_type = :user_notification_preference_type");
     $stat->execute(array('user_id' => $user->getId(), 'extension_id' => $extensionId, 'user_notification_preference_type' => $userNotificationPreferenceType));
     # update or insert
     if ($stat->rowCount() > 0) {
         $stat = $DB->prepare("UPDATE user_notification_preference SET is_email = :is_email " . "WHERE user_id =:user_id AND extension_id=:extension_id AND user_notification_preference_type = :user_notification_preference_type");
     } else {
         $stat = $DB->prepare("INSERT INTO user_notification_preference (user_id,extension_id,user_notification_preference_type,is_email) " . "VALUES (:user_id,:extension_id,:user_notification_preference_type,:is_email)");
     }
     $stat->execute(array('user_id' => $user->getId(), 'extension_id' => $extensionId, 'user_notification_preference_type' => $userNotificationPreferenceType, 'is_email' => $value ? 1 : 0));
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:14,代碼來源:UserNotificationPreferenceRepository.php

示例6: 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

示例7: build

 protected function build()
 {
     if ($this->onlyCurrent) {
         $this->joins[] = " JOIN group_information ON group_information.id = user_watches_group_information.group_id  ";
         $this->joins[] = " LEFT JOIN user_watches_site_information ON user_watches_site_information.site_id = group_information.site_id " . "AND user_watches_site_information.user_account_id = user_watches_group_information.user_account_id " . " AND user_watches_site_information.is_watching = '1' ";
         $this->where[] = " user_watches_group_information.is_watching = '1' AND user_watches_site_information.is_watching IS NULL ";
     }
     if ($this->group) {
         $this->where[] = " user_watches_group_information.group_id = :group_id";
         $this->params['group_id'] = $this->group->getId();
     }
     if ($this->user) {
         $this->where[] = " user_watches_group_information.user_account_id = :user_account_id";
         $this->params['user_account_id'] = $this->user->getId();
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:16,代碼來源:UserWatchesGroupRepositoryBuilder.php

示例8: userLogIn

function userLogIn(UserAccountModel $user)
{
    global $WEBSESSION;
    if (!$user->getIsClosedBySysAdmin()) {
        $WEBSESSION->set('userID', $user->getId());
    }
}
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:7,代碼來源:autoloadWebApp.php

示例9: 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

示例10: 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

示例11: 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

示例12: getLastSentForUserAccount

 public function getLastSentForUserAccount(UserAccountModel $user)
 {
     global $DB;
     $stat = $DB->prepare("SELECT MAX(created_at) AS c FROM user_account_verify_email WHERE user_account_id=:user_account_id");
     $stat->execute(array('user_account_id' => $user->getId()));
     $data = $stat->fetch();
     return $data['c'] ? new \DateTime($data['c'], new \DateTimeZone('UTC')) : null;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:8,代碼來源:UserAccountVerifyEmailRepository.php

示例13: build

 protected function build()
 {
     $this->select[] = ' curated_list_information.* ';
     if ($this->userAccount) {
         $this->joins[] = " JOIN user_in_curated_list_information ON user_in_curated_list_information.curated_list_id = curated_list_information.id " . "AND user_in_curated_list_information.user_account_id = :user_account_id ";
         $this->params['user_account_id'] = $this->userAccount->getId();
         $this->where[] = " (user_in_curated_list_information.is_owner = '1' OR user_in_curated_list_information.is_editor = '1'  ) ";
     }
     if ($this->site) {
         $this->where[] = " curated_list_information.site_id = :site_id ";
         $this->params['site_id'] = $this->site->getId();
     }
     if ($this->containsEvent) {
         $this->params['event_id'] = $this->containsEvent->getId();
         // event directly in list?
         $this->joins[] = " LEFT JOIN event_in_curated_list ON event_in_curated_list.curated_list_id = curated_list_information.id AND   " . " event_in_curated_list.event_id = :event_id AND event_in_curated_list.removed_at IS NULL ";
         // event in list via group?
         $this->joins[] = " LEFT JOIN ( SELECT group_in_curated_list.curated_list_id, MAX(group_in_curated_list.group_id) AS group_id FROM group_in_curated_list " . " JOIN event_in_group ON event_in_group.group_id = group_in_curated_list.group_id " . " WHERE event_in_group.event_id = :event_id AND group_in_curated_list.removed_at IS NULL AND event_in_group.removed_at IS NULL " . " GROUP BY group_in_curated_list.curated_list_id ) AS event_in_curated_list_via_group_table ON event_in_curated_list_via_group_table.curated_list_id = curated_list_information.id ";
         $this->where[] = " (event_in_curated_list.added_at IS NOT NULL OR event_in_curated_list_via_group_table.group_id IS NOT NULL) ";
     } else {
         if ($this->eventInfo) {
             $this->params['event_id'] = $this->eventInfo->getId();
             // event directly in list?
             $this->joins[] = " LEFT JOIN event_in_curated_list ON event_in_curated_list.curated_list_id = curated_list_information.id AND   " . " event_in_curated_list.event_id = :event_id AND event_in_curated_list.removed_at IS NULL ";
             $this->select[] = " event_in_curated_list.added_at AS is_event_in_list ";
             // event in list via group?
             $this->joins[] = " LEFT JOIN ( SELECT group_in_curated_list.curated_list_id, MAX(group_in_curated_list.group_id) AS group_id FROM group_in_curated_list " . " JOIN event_in_group ON event_in_group.group_id = group_in_curated_list.group_id " . " WHERE event_in_group.event_id = :event_id AND group_in_curated_list.removed_at IS NULL AND event_in_group.removed_at IS NULL " . " GROUP BY group_in_curated_list.curated_list_id ) AS event_in_curated_list_via_group_table ON event_in_curated_list_via_group_table.curated_list_id = curated_list_information.id ";
             $this->select[] = " event_in_curated_list_via_group_table.group_id AS event_in_list_via_group_id ";
         }
     }
     if ($this->containsGroup) {
         $this->joins[] = " LEFT JOIN group_in_curated_list ON group_in_curated_list.curated_list_id = curated_list_information.id AND   " . " group_in_curated_list.group_id = :group_id AND group_in_curated_list.removed_at IS NULL ";
         $this->params['group_id'] = $this->containsGroup->getId();
         $this->where[] = " group_in_curated_list.added_at IS NOT NULL ";
     } else {
         if ($this->groupInfo) {
             $this->joins[] = " LEFT JOIN group_in_curated_list ON group_in_curated_list.curated_list_id = curated_list_information.id AND   " . " group_in_curated_list.group_id = :group_id AND group_in_curated_list.removed_at IS NULL ";
             $this->params['group_id'] = $this->groupInfo->getId();
             $this->select[] = " group_in_curated_list.added_at AS is_group_in_list ";
         }
     }
     if (!$this->include_deleted) {
         $this->where[] = " curated_list_information.is_deleted = '0' ";
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:45,代碼來源:CuratedListRepositoryBuilder.php

示例14: getForUser

 /**
  * This will always return something. If one doesn't exist, one will be created.
  * @return UserAccountPrivateFeedKeyModel
  */
 public function getForUser(UserAccountModel $user)
 {
     global $DB;
     $stat = $DB->prepare("SELECT * FROM user_account_general_security_key WHERE user_account_id=:uid");
     $stat->execute(array('uid' => $user->getId()));
     if ($stat->rowCount() > 0) {
         $uagskm = new UserAccountGeneralSecurityKeyModel();
         $uagskm->setFromDataBaseRow($stat->fetch());
         return $uagskm;
     }
     $uagskm = new UserAccountGeneralSecurityKeyModel();
     $uagskm->setUserAccountId($user->getId());
     $uagskm->setAccessKey(createKey(2, 150));
     // TODO check not already used
     $stat = $DB->prepare("INSERT INTO user_account_general_security_key (user_account_id, access_key, created_at) " . "VALUES (:user_account_id, :access_key, :created_at)");
     $stat->execute(array('user_account_id' => $uagskm->getUserAccountId(), 'access_key' => $uagskm->getAccessKey(), 'created_at' => \TimeSource::getFormattedForDataBase()));
     return $uagskm;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:22,代碼來源:UserAccountGeneralSecurityKeyRepository.php

示例15: getForUserAndGroup

 /**
  * This will always return something. If one doesn't exist, one will be created.
  * @return UserWatchesSiteStopModel
  */
 public function getForUserAndGroup(UserAccountModel $user, GroupModel $group)
 {
     global $DB;
     $stat = $DB->prepare("SELECT * FROM user_watches_group_stop WHERE user_account_id=:uid AND group_id=:gid");
     $stat->execute(array('uid' => $user->getId(), 'gid' => $group->getId()));
     if ($stat->rowCount() > 0) {
         $uwgs = new UserWatchesGroupStopModel();
         $uwgs->setFromDataBaseRow($stat->fetch());
         return $uwgs;
     }
     $uwgs = new UserWatchesGroupStopModel();
     $uwgs->setUserAccountId($user->getId());
     $uwgs->setGroupId($group->getId());
     $uwgs->setAccessKey(createKey(2, 150));
     // TODO check not already used
     $stat = $DB->prepare("INSERT INTO user_watches_group_stop (user_account_id, group_id, access_key, created_at) " . "VALUES (:user_account_id, :group_id, :access_key, :created_at)");
     $stat->execute(array('user_account_id' => $uwgs->getUserAccountId(), 'group_id' => $uwgs->getGroupId(), 'access_key' => $uwgs->getAccessKey(), 'created_at' => \TimeSource::getFormattedForDataBase()));
     return $uwgs;
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:23,代碼來源:UserWatchesGroupStopRepository.php


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