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


PHP Gems_Loader::getUserLoader方法代码示例

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


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

示例1: afterRegistry

 public function afterRegistry()
 {
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     parent::afterRegistry();
     $this->user = $this->loader->getUserLoader()->getUserByStaffId($this->staffId);
     $mailFields = $this->user->getMailFields();
     $this->addMailFields($mailFields);
     $this->addTo($this->user->getEmailAddress(), $this->user->getFullName());
     $this->setLanguage($this->user->getLocale());
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:10,代码来源:StaffMailer.php

示例2: getCurrentOrganizationId

 /**
  * Returns the organization id that should currently be used for this form.
  *
  * @return int Returns the current organization id, if any
  */
 public function getCurrentOrganizationId()
 {
     $userLoader = $this->loader->getUserLoader();
     // Url determines organization first.
     if ($orgId = $userLoader->getOrganizationIdByUrl()) {
         $this->_organizationFromUrl = true;
         $userLoader->getCurrentUser()->setCurrentOrganization($orgId);
         return $orgId;
     }
     $request = $this->getRequest();
     if ($request->isPost() && ($orgId = $request->getParam($this->organizationFieldName))) {
         return $orgId;
     }
     return $userLoader->getCurrentUser()->getCurrentOrganizationId();
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:20,代码来源:OrganizationFormAbstract.php

示例3: translateRowValues

 /**
  * Add organization id and gul_user_class when needed
  *
  * @param mixed $row array or \Traversable row
  * @param scalar $key
  * @return mixed Row array or false when errors occurred
  */
 public function translateRowValues($row, $key)
 {
     $row = parent::translateRowValues($row, $key);
     if (!$row) {
         return false;
     }
     if (!isset($row['gsf_id_organization'])) {
         $row['gsf_id_organization'] = $this->_organization->getId();
         if (!isset($row['gul_user_class'])) {
             $row['gul_user_class'] = $this->_organization->get('gor_user_class');
         }
     } elseif (!isset($row['gul_user_class'])) {
         $row['gul_user_class'] = $this->loader->getUserLoader()->getOrganization($row['gsf_id_organization'])->get('gor_user_class');
     }
     return $row;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:23,代码来源:StaffTranslator.php

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

示例5: save

 /**
  * Save a single model item.
  *
  * Makes sure the password is saved too using the userclass
  *
  * @param array $newValues The values to store for a single model item.
  * @param array $filter If the filter contains old key values these are used
  * to decide on update versus insert.
  * @param array $saveTables Optional array containing the table names to save,
  * otherwise the tables set to save at model level will be saved.
  * @return array The values as they are after saving (they may change).
  */
 public function save(array $newValues, array $filter = null, array $saveTables = null)
 {
     //First perform a save
     $savedValues = parent::save($newValues, $filter, $saveTables);
     //Now check if we need to save config values
     if (isset($newValues['gor_user_class']) && !empty($newValues['gor_user_class'])) {
         $definition = $this->loader->getUserLoader()->getUserDefinition($newValues['gor_user_class']);
         if ($definition instanceof \Gems_User_UserDefinitionConfigurableInterface && $definition->hasConfig()) {
             $savedValues = $definition->saveConfig($savedValues, $newValues);
             if ($definition->getConfigChanged() > 0 && $this->getChanged() < 1) {
                 $this->setChanged(1);
             }
         }
     }
     return $savedValues;
 }
开发者ID:harmslijper,项目名称:gemstracker-library,代码行数:28,代码来源:OrganizationModel.php

示例6: save

 /**
  * Save a single model item.
  *
  * Makes sure the password is saved too using the userclass
  *
  * @param array $newValues The values to store for a single model item.
  * @param array $filter If the filter contains old key values these are used
  * to decide on update versus insert.
  * @param array $saveTables Optional array containing the table names to save,
  * otherwise the tables set to save at model level will be saved.
  * @return array The values as they are after saving (they may change).
  */
 public function save(array $newValues, array $filter = null, array $saveTables = null)
 {
     //First perform a save
     $savedValues = parent::save($newValues, $filter, $saveTables);
     //Now check if we need to set the password
     if (isset($newValues['fld_password']) && !empty($newValues['fld_password'])) {
         if ($this->getChanged() < 1) {
             $this->setChanged(1);
         }
         //Now load the userclass and save the password use the $savedValues as for a new
         //user we might not have the id in the $newValues
         $user = $this->loader->getUserLoader()->getUserByStaffId($savedValues['gsf_id_user']);
         if ($user->canSetPassword()) {
             $user->setPassword($newValues['fld_password']);
         }
     }
     return $savedValues;
 }
开发者ID:GemsTracker,项目名称:gemstracker-library,代码行数:30,代码来源:StaffModel.php


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