本文整理匯總了PHP中cache::notify_step_change方法的典型用法代碼示例。如果您正苦於以下問題:PHP cache::notify_step_change方法的具體用法?PHP cache::notify_step_change怎麽用?PHP cache::notify_step_change使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cache
的用法示例。
在下文中一共展示了cache::notify_step_change方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: reset_step_sortorder
/**
* Reset the sortorder for all steps in the tour.
*
* @return $this
*/
public function reset_step_sortorder()
{
global $DB;
$steps = $DB->get_records('tool_usertours_steps', array('tourid' => $this->id), 'sortorder ASC', 'id');
$index = 0;
foreach ($steps as $step) {
$DB->set_field('tool_usertours_steps', 'sortorder', $index, array('id' => $step->id));
$index++;
}
// Notify of a change to the step configuration.
// Note: Do not notify of a tour change here. This is only a step change for a tour.
cache::notify_step_change($this->get_id());
return $this;
}
示例2: 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();
}