当前位置: 首页>>代码示例>>PHP>>正文


PHP Settings::getUserSetting方法代码示例

本文整理汇总了PHP中thebuggenie\core\framework\Settings::getUserSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP Settings::getUserSetting方法的具体用法?PHP Settings::getUserSetting怎么用?PHP Settings::getUserSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thebuggenie\core\framework\Settings的用法示例。


在下文中一共展示了Settings::getUserSetting方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getOrGenerateRssKey

 protected function _getOrGenerateRssKey()
 {
     static $key;
     $key = $key === null ? framework\Settings::getUserSetting($this->getID(), framework\Settings::USER_RSS_KEY) : $key;
     if ($key === null) {
         $key = $this->regenerateRssKey();
     }
     return $key;
 }
开发者ID:underblaze,项目名称:thebuggenie-4.1.0,代码行数:9,代码来源:User.php

示例2: _postSave

 protected function _postSave($is_new)
 {
     if ($is_new) {
         $tty = $this->getTargetType();
         $tid = $this->getTargetID();
         if (array_key_exists($tty, self::$_comment_count) && array_key_exists($tid, self::$_comment_count[$tty]) && array_key_exists((int) $this->isSystemComment(), self::$_comment_count[$tty][$tid])) {
             self::$_comment_count[$tty][$tid][(int) $this->isSystemComment()]++;
         }
         if (!$this->isSystemComment()) {
             if ($this->_getParser()->hasMentions()) {
                 foreach ($this->_getParser()->getMentions() as $user) {
                     if ($user->getID() == framework\Context::getUser()->getID()) {
                         continue;
                     }
                     if ($user->getNotificationSetting(framework\Settings::SETTINGS_USER_NOTIFY_MENTIONED, false)->isOn()) {
                         $this->_addNotificationIfNotNotified(Notification::TYPE_COMMENT_MENTIONED, $user, $this->getPostedBy());
                     }
                 }
             }
             if ($this->getTargetType() == self::TYPE_ISSUE) {
                 if (framework\Settings::getUserSetting(framework\Settings::SETTINGS_USER_SUBSCRIBE_CREATED_UPDATED_COMMENTED_ISSUES, $this->getPostedByID())) {
                     $this->getTarget()->addSubscriber($this->getPostedByID());
                 }
             }
             if ($this->getTargetType() == self::TYPE_ARTICLE) {
                 if (framework\Settings::getUserSetting(framework\Settings::SETTINGS_USER_SUBSCRIBE_CREATED_UPDATED_COMMENTED_ARTICLES, $this->getPostedByID())) {
                     $this->getTarget()->addSubscriber($this->getPostedByID());
                 }
             }
             $this->_addTargetNotifications();
         }
     } else {
         switch ($this->getTargetType()) {
             case self::TYPE_ISSUE:
                 \thebuggenie\core\framework\Event::createNew('core', 'thebuggenie\\core\\entities\\Comment::_postSave', $this, array('issue' => $this->getTarget()))->trigger();
                 break;
             case self::TYPE_ARTICLE:
                 \thebuggenie\core\framework\Event::createNew('core', 'thebuggenie\\core\\entities\\Comment::_postSave', $this, array('article' => $this->getTarget()))->trigger();
                 break;
             default:
                 return;
         }
     }
     $this->touchTargetIfItsIssue();
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:45,代码来源:Comment.php

示例3: _postSave

 protected function _postSave($is_new)
 {
     $this->_saveCustomFieldValues();
     if (!$is_new) {
         $related_issues_to_save = $this->_processChanges();
         $comment = isset($this->_save_comment) ? $this->_save_comment : $this->addSystemComment('', framework\Context::getUser()->getID());
         $this->triggerSaveEvent($comment, framework\Context::getUser());
         if (count($related_issues_to_save)) {
             foreach (array_keys($related_issues_to_save) as $i_id) {
                 $related_issue = \thebuggenie\core\entities\Issue::getB2DBTable()->selectById((int) $i_id);
                 $related_issue->save();
             }
         }
     } else {
         $_description_parser = $this->_getDescriptionParser();
         $_reproduction_steps_parser = $this->_getReproductionStepsParser();
         if (!is_null($_description_parser) && $_description_parser->hasMentions()) {
             foreach ($_description_parser->getMentions() as $user) {
                 if ($user->getID() == framework\Context::getUser()->getID()) {
                     continue;
                 }
                 $this->_addNotification(Notification::TYPE_ISSUE_MENTIONED, $user, $this->getPostedBy());
             }
         }
         if (!is_null($_reproduction_steps_parser) && $_reproduction_steps_parser->hasMentions()) {
             foreach ($_reproduction_steps_parser->getMentions() as $user) {
                 if ($user->getID() == framework\Context::getUser()->getID()) {
                     continue;
                 }
                 $this->_addNotification(Notification::TYPE_ISSUE_MENTIONED, $user, $this->getPostedBy());
             }
         }
         $this->addLogEntry(tables\Log::LOG_ISSUE_CREATED, null, false, $this->getPosted());
         $this->_addCreateNotifications($this->getPostedBy());
         \thebuggenie\core\framework\Event::createNew('core', 'thebuggenie\\core\\entities\\Issue::createNew', $this)->trigger();
     }
     if (in_array(\thebuggenie\core\framework\Settings::getUserSetting(\thebuggenie\core\framework\Settings::SETTINGS_USER_SUBSCRIBE_CREATED_UPDATED_COMMENTED_ISSUES, framework\Context::getUser()->getID()), array(null, true))) {
         $this->addSubscriber(framework\Context::getUser()->getID());
     }
     $this->_clearChangedProperties();
     $this->_log_items_added = array();
     $this->getProject()->clearRecentActivities();
     if ($this->isChildIssue() && ($this->hasEstimatedTime() || $this->hasSpentTime())) {
         foreach ($this->getParentIssues() as $issue) {
             $issue->calculateTime();
             $issue->save();
         }
     }
     if ($this->getMilestone() instanceof \thebuggenie\core\entities\Milestone) {
         $this->getMilestone()->updateStatus();
         $this->getMilestone()->save();
     }
     return true;
 }
开发者ID:AzerothShard,项目名称:thebuggenie,代码行数:54,代码来源:Issue.php

示例4: _postSave

 protected function _postSave($is_new)
 {
     if ($is_new) {
         $tty = $this->getTargetType();
         $tid = $this->getTargetID();
         if (array_key_exists($tty, self::$_comment_count) && array_key_exists($tid, self::$_comment_count[$tty]) && array_key_exists((int) $this->isSystemComment(), self::$_comment_count[$tty][$tid])) {
             self::$_comment_count[$tty][$tid][(int) $this->isSystemComment()]++;
         }
         if (!$this->isSystemComment()) {
             if ($this->_getParser()->hasMentions()) {
                 foreach ($this->_getParser()->getMentions() as $user) {
                     if ($user->getID() == framework\Context::getUser()->getID()) {
                         continue;
                     }
                     $this->_addNotification(Notification::TYPE_COMMENT_MENTIONED, $user);
                 }
             }
             if ($this->getTargetType() == self::TYPE_ISSUE) {
                 $this->_addIssueNotifications();
                 if (framework\Settings::getUserSetting(framework\Settings::SETTINGS_USER_SUBSCRIBE_CREATED_UPDATED_COMMENTED_ISSUES, $this->getPostedByID())) {
                     $this->getTarget()->addSubscriber($this->getPostedByID());
                 }
             }
             if ($this->getTargetType() == self::TYPE_ARTICLE) {
                 if (framework\Settings::getUserSetting(framework\Settings::SETTINGS_USER_SUBSCRIBE_CREATED_UPDATED_COMMENTED_ARTICLES, $this->getPostedByID())) {
                     $this->getTarget()->addSubscriber($this->getPostedByID());
                 }
             }
         }
     }
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:31,代码来源:Comment.php


注:本文中的thebuggenie\core\framework\Settings::getUserSetting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。