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


PHP Gems_Loader::getUser方法代碼示例

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


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

示例1: afterSave

 /**
  * Hook that allows actions when data was saved
  *
  * When not rerouted, the form will be populated afterwards
  *
  * @param int $changed The number of changed rows (0 or 1 usually, but can be more)
  */
 protected function afterSave($changed)
 {
     if ($changed) {
         $this->accesslog->logChange($this->request, null, $this->formData);
         // Reload the current user data
         $user = $this->currentUser;
         $currentOrg = $user->getCurrentOrganizationId();
         $this->loader->getUserLoader()->unsetCurrentUser();
         $user = $this->loader->getUser($user->getLoginName(), $user->getBaseOrganizationId())->setAsCurrentUser();
         $user->setCurrentOrganization($currentOrg);
         // In case locale has changed, set it in a cookie
         \Gems_Cookies::setLocale($this->formData['gsf_iso_lang'], $this->basepath);
         $this->addMessage($this->_('Saved your setup data', $this->formData['gsf_iso_lang']));
     } else {
         $this->addMessage($this->_('No changes to save!'));
     }
     if ($this->cacheTags && $this->cache instanceof \Zend_Cache_Core) {
         $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, (array) $this->cacheTags);
     }
 }
開發者ID:GemsTracker,項目名稱:gemstracker-library,代碼行數:27,代碼來源:OwnAccountEditSnippet.php

示例2: isValid

 /**
  * Validate the form
  *
  * As it is better for translation utilities to set the labels etc. translated,
  * the MUtil default is to disable translation.
  *
  * However, this also disables the translation of validation messages, which we
  * cannot set translated. The MUtil form is extended so it can make this switch.
  *
  * @param  array   $data
  * @param  boolean $disableTranslateValidators Extra switch
  * @return boolean
  */
 public function isValid($data, $disableTranslateValidators = null)
 {
     $this->_user = $this->loader->getUser(isset($data[$this->usernameFieldName]) ? $data[$this->usernameFieldName] : null, isset($data[$this->organizationFieldName]) ? $data[$this->organizationFieldName] : '');
     return parent::isValid($data, $disableTranslateValidators);
 }
開發者ID:GemsTracker,項目名稱:gemstracker-library,代碼行數:18,代碼來源:OrganizationFormAbstract.php


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