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


PHP cache::notify_tour_change方法代码示例

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


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

示例1: reset_tour_sortorder

 /**
  * Reset the sortorder for all tours.
  */
 public static function reset_tour_sortorder()
 {
     global $DB;
     $tours = $DB->get_records('tool_usertours_tours', null, 'sortorder ASC, pathmatch DESC', 'id, sortorder');
     $index = 0;
     foreach ($tours as $tour) {
         if ($tour->sortorder != $index) {
             $DB->set_field('tool_usertours_tours', 'sortorder', $index, array('id' => $tour->id));
         }
         $index++;
     }
     // Notify the cache that a tour has changed.
     // Tours are only stored in the cache if there are steps.
     // If there step count has changed for some reason, this will change the potential cache results.
     cache::notify_tour_change();
 }
开发者ID:dg711,项目名称:moodle,代码行数:19,代码来源:helper.php

示例2: persist

 /**
  * Save the tour and it's configuration to the database.
  *
  * @param   boolean     $force      Whether to force writing to the database.
  * @return  $this
  */
 public function persist($force = false)
 {
     global $DB;
     if (!$this->dirty && !$force) {
         return $this;
     }
     if ($this->id) {
         $record = $this->to_record();
         $DB->update_record('tool_usertours_tours', $record);
     } else {
         $this->calculate_sortorder();
         $record = $this->to_record();
         unset($record->id);
         $this->id = $DB->insert_record('tool_usertours_tours', $record);
     }
     $this->reload();
     // Notify the cache that a tour has changed.
     cache::notify_tour_change();
     return $this;
 }
开发者ID:dg711,项目名称:moodle,代码行数:26,代码来源:tour.php

示例3: remove

 /**
  * Remove this step.
  */
 public function remove()
 {
     global $DB;
     if ($this->id === null) {
         return;
     }
     $DB->delete_records('tool_usertours_steps', array('id' => $this->id));
     $this->get_tour()->reset_step_sortorder();
     // Notify of a change to the step configuration.
     // This must be done separately to tour change notifications.
     cache::notify_step_change($this->get_id());
     // Notify the cache that a tour has changed.
     // Tours are only stored in the cache if there are steps.
     // If there step count has changed for some reason, this will change the potential cache results.
     cache::notify_tour_change();
 }
开发者ID:dg711,项目名称:moodle,代码行数:19,代码来源:step.php


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