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


PHP FabrikWorker::getCache方法代码示例

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


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

示例1: onBeforeListRender

 /**
  * Try to cache the list data
  */
 public function onBeforeListRender()
 {
     if (!$this->params->get('pivot_cache')) {
         return;
     }
     $cache = FabrikWorker::getCache();
     $cache->setCaching(1);
     $res = $cache->call(array(get_class($this), 'cacheResults'), $this->model->getId());
     $this->model->set('data', $res);
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:13,代码来源:pivot.php

示例2: getColumnData

 /**
  * Get a single column of data from the table, test for element filters
  *
  * @param   mixed  $col       Column to grab. Element full name or id
  * @param   bool   $distinct  Select distinct values only
  * @param   array  $opts      Options: filterLimit bool - should limit to filter_list_max global param (default true)
  *                                     where - additional where filter to apply to query (@since 3.0.8)
  *
  * @return  array  Values for the column - empty array if no results found
  */
 public function getColumnData($col, $distinct = true, $opts = array())
 {
     if (!array_key_exists($col, $this->columnData)) {
         $fbConfig = JComponentHelper::getParams('com_fabrik');
         $cache = FabrikWorker::getCache($this);
         $opts['filters'] = $this->filters;
         $res = $cache->call(array(get_class($this), 'columnData'), $this->getId(), $col, $distinct, $opts);
         if (is_null($res)) {
             $this->app->enqueueMessage('list model getColumn Data for ' . $col . ' failed', 'notice');
             $res = array();
         }
         if ((int) $fbConfig->get('filter_list_max', 100) == count($res)) {
             $this->app->enqueueMessage(JText::sprintf('COM_FABRIK_FILTER_LIST_MAX_REACHED', $col), 'notice');
         }
         $this->columnData[$col] = $res;
     }
     return $this->columnData[$col];
 }
开发者ID:pascal26,项目名称:fabrik,代码行数:28,代码来源:list.php

示例3: getColumnData

 /**
  * Get a single column of data from the table, test for element filters
  *
  * @param   string  $col  column to get
  *
  * @return  array  values for the column - empty array if no results found
  */
 public function getColumnData($col)
 {
     if (!array_key_exists($col, $this->columnData)) {
         $fbConfig = JComponentHelper::getParams('com_fabrik');
         $cache = FabrikWorker::getCache();
         $res = $cache->call(array(get_class($this), 'columnData'), $this->getId(), $col);
         if (is_null($res)) {
             JError::raiseNotice(500, 'list model getColumn Data for ' . $col . ' failed');
         }
         if ((int) $fbConfig->get('filter_list_max', 100) == count($res)) {
             JError::raiseNotice(500, JText::sprintf('COM_FABRIK_FILTER_LIST_MAX_REACHED', $col));
         }
         if (is_null($res)) {
             $res = array();
         }
         $this->columnData[$col] = $res;
     }
     return $this->columnData[$col];
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:26,代码来源:list.php

示例4: onAutocomplete_options

 /**
  * Ajax call to get auto complete options (now caches results)
  *
  * @return  string  json encoded options
  */
 public function onAutocomplete_options()
 {
     // Needed for ajax update (since we are calling this method via dispatcher element is not set)
     $this->setId(JRequest::getInt('element_id'));
     $this->getElement(true);
     $cache = FabrikWorker::getCache();
     $search = JRequest::getVar('value');
     echo $cache->call(array(get_class($this), 'cacheAutoCompleteOptions'), $this, $search);
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:14,代码来源:element.php

示例5: onAutocomplete_options

 /**
  * Ajax call to get auto complete options (now caches results)
  *
  * @return  string  json encoded options
  */
 public function onAutocomplete_options()
 {
     // Needed for ajax update (since we are calling this method via dispatcher element is not set)
     $input = $this->app->input;
     $this->setId($input->getInt('element_id'));
     $this->loadMeForAjax();
     $cache = FabrikWorker::getCache();
     $search = $input->get('value', '', 'string');
     echo $cache->call(array(get_class($this), 'cacheAutoCompleteOptions'), $this, $search);
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:15,代码来源:element.php


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