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


PHP Context::isUpgrademode方法代码示例

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


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

示例1: getSettingsForScope

 public function getSettingsForScope($scope, $uid = 0)
 {
     $crit = $this->getCriteria();
     if (framework\Context::isUpgrademode()) {
         $crit->addSelectionColumn(self::NAME);
         $crit->addSelectionColumn(self::MODULE);
         $crit->addSelectionColumn(self::VALUE);
         $crit->addSelectionColumn(self::UID);
         $crit->addSelectionColumn(self::SCOPE);
     }
     $ctn = $crit->returnCriterion(self::SCOPE, $scope);
     $ctn->addOr(self::SCOPE, 0);
     $crit->addWhere($ctn);
     $crit->addWhere(self::UID, $uid);
     $res = $this->doSelect($crit, 'none');
     return $res;
 }
开发者ID:pkdevboxy,项目名称:thebuggenie,代码行数:17,代码来源:Settings.php

示例2: _preSave

 /**
  * Pre-save function to check for conflicting usernames and to make
  * sure some properties are set
  *
  * @param boolean $is_new Whether this is a new user object
  */
 protected function _preSave($is_new)
 {
     parent::_preSave($is_new);
     if (!framework\Context::isInstallmode() && !framework\Context::isUpgrademode()) {
         $compare_user = self::getByUsername($this->getUsername());
         if ($compare_user instanceof User && $compare_user->getID() && $compare_user->getID() != $this->getID()) {
             throw new \Exception(framework\Context::getI18n()->__('This username already exists'));
         }
     }
     if ($is_new) {
         // In case the postsave event isn't processed we automatically enable the user
         // since we can't be sure that an activation email has been sent out
         $this->setEnabled();
         $this->setActivated();
     }
     if (!$this->_realname) {
         $this->_realname = $this->_username;
     }
     if (!$this->_buddyname) {
         $this->_buddyname = $this->_username;
     }
     if (is_object($this->_timezone)) {
         $this->_timezone = $this->_timezone->getName();
     }
     if ($is_new && $this->_joined === 0) {
         $this->_joined = NOW;
     }
     if ($is_new && $this->_group_id === null) {
         $this->setGroup(framework\Settings::getDefaultGroup());
     }
     if ($this->_deleted) {
         try {
             if ($this->getGroup() instanceof \thebuggenie\core\entities\Group) {
                 $this->getGroup()->removeMember($this);
             }
         } catch (\Exception $e) {
         }
         $this->_group_id = null;
         $this->_buddyname = $this->_username;
         $this->_username = '';
         if (!$is_new) {
             tables\TeamMembers::getTable()->clearTeamsByUserID($this->getID());
             tables\ClientMembers::getTable()->clearClientsByUserID($this->getID());
             tables\UserScopes::getTable()->clearUserScopes($this->getID());
         }
     }
 }
开发者ID:underblaze,项目名称:thebuggenie-4.1.0,代码行数:53,代码来源:User.php


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