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


PHP JUser::getParam方法代码示例

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


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

示例1: getParam

 /**
  * Get param from user storage
  * @param string $key
  * @param mixed  $default
  * @return mixed
  */
 public function getParam($key, $default = null)
 {
     $params = (array) $this->_user->getParam(self::PARAM_NAMESPACE, array());
     if (isset($params[$key])) {
         return $params[$key];
     }
     return $default;
 }
开发者ID:alexmixaylov,项目名称:real,代码行数:14,代码来源:jbuser.php

示例2: testParameter

 /**
  * Tests JUser Parameter setting and retrieval.
  *
  * @return  void
  *
  * @since   12.1
  *
  * @covers JUser::defParam
  * @covers JUser::getParam
  * @covers JUser::setParam
  */
 public function testParameter()
 {
     $this->assertThat($this->object->getParam('holy', 'fred'), $this->equalTo('fred'));
     $this->object->defParam('holy', 'batman');
     $this->assertThat($this->object->getParam('holy', 'fred'), $this->equalTo('batman'));
     $this->object->setParam('holy', 'batman');
     $this->assertThat($this->object->getParam('holy', 'fred'), $this->equalTo('batman'));
 }
开发者ID:SysBind,项目名称:joomla-cms,代码行数:19,代码来源:JUserTest.php

示例3: getParam

 /**
  * Method to get a parameter value from CMS user object
  *
  * @param   string  $key      Parameter key
  * @param   mixed   $default  Parameter default value
  * @param   string  $type     [optional] Default: GetterInterface::RAW. Or const int GetterInterface::COMMAND|GetterInterface::INT|... or array( const ) or array( $key => const )
  * @return  mixed             The value or the default if it did not exist
  */
 public function getParam($key, $default = null, $type = GetterInterface::RAW)
 {
     return Get::clean($this->cmsOwnUser->getParam($key, $default), $type);
 }
开发者ID:Raul-mz,项目名称:web-erpcya,代码行数:12,代码来源:CmsUser.php

示例4: published

 function published($publish)
 {
     $db = JFactory::getDBO();
     $ids = JRequest::getVar('cid', array());
     $ids = implode(',', $ids);
     $query = "UPDATE #__jav_items" . " SET published = " . intval($publish) . " WHERE id IN ( {$ids} )";
     $db->setQuery($query);
     if (!$db->query()) {
         return false;
     }
     foreach (JRequest::getVar('cid', array()) as $id) {
         $item = $this->getItem(array($id));
         $logs = $this->getLogs(" and item_id={$id}");
         if ($logs) {
             foreach ($logs as $log) {
                 $user = JFactory::getUser($log->user_id);
                 $user_no_session = new JUser($log->user_id);
                 $total_voted = (int) $user_no_session->getParam('total-voted-' . $item->voice_types_id);
                 if ($publish == 0) {
                     $total_voted = (int) ($total_voted - abs($log->votes));
                 } else {
                     $total_voted = (int) ($total_voted + abs($log->votes));
                 }
                 if ($total_voted < 0) {
                     $total_voted = 0;
                 }
                 $user_no_session->setParam('total-voted-' . $item->voice_types_id, $total_voted);
                 $user_no_session->save();
             }
         }
     }
     return true;
 }
开发者ID:jomsocial,项目名称:JSVoice,代码行数:33,代码来源:items.php


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