本文整理汇总了PHP中HC_Lib::get_combinations方法的典型用法代码示例。如果您正苦于以下问题:PHP HC_Lib::get_combinations方法的具体用法?PHP HC_Lib::get_combinations怎么用?PHP HC_Lib::get_combinations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HC_Lib
的用法示例。
在下文中一共展示了HC_Lib::get_combinations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calendar_refresh
function calendar_refresh($model)
{
$final_parent_refresh = array();
$dates = $model->get_dates();
foreach ($dates as $date) {
$refresh_keys = array();
$refresh_keys[] = 'dat-' . $date;
$refresh_keys[] = $model->user_id ? 'use-' . $model->user_id : 'use-0';
$this_parent_refresh = HC_Lib::get_combinations($refresh_keys);
reset($this_parent_refresh);
foreach ($this_parent_refresh as $pr) {
$final_parent_refresh[join('-', $pr)] = 1;
}
}
$return = $final_parent_refresh;
return $return;
}
示例2: calendar_refresh
function calendar_refresh($model)
{
$refresh_keys = array();
$refresh_keys[] = 'dat-' . $model->date;
$refresh_keys[] = $model->location_id ? 'loc-' . $model->location_id : 'loc-0';
$refresh_keys[] = $model->user_id ? 'use-' . $model->user_id : 'use-0';
$parent_refresh = HC_Lib::get_combinations($refresh_keys);
$refresh_keys2 = array();
$changes = $model->get_changes();
if (!array_key_exists('id', $changes)) {
if (array_intersect(array('date', 'user_id', 'location_id'), array_keys($changes))) {
if (array_key_exists('user_id', $changes)) {
$refresh_keys2[] = $changes['user_id'] ? 'use-' . $changes['user_id'] : 'use-0';
} else {
$refresh_keys2[] = $model->user_id ? 'use-' . $model->user_id : 'use-0';
}
if (array_key_exists('location_id', $changes)) {
$refresh_keys2[] = $changes['location_id'] ? 'loc-' . $changes['location_id'] : 'loc-0';
} else {
$refresh_keys2[] = $model->location_id ? 'loc-' . $model->location_id : 'loc-0';
}
if (array_key_exists('date', $changes)) {
$refresh_keys2[] = $changes['date'] ? 'dat-' . $changes['date'] : 'dat-0';
} else {
$refresh_keys2[] = 'dat-' . $model->date;
}
}
}
if ($refresh_keys2) {
$parent_refresh2 = HC_Lib::get_combinations($refresh_keys2);
$parent_refresh = array_merge($parent_refresh, $parent_refresh2);
}
$final_parent_refresh = array();
foreach ($parent_refresh as $pr) {
$final_parent_refresh[join('-', $pr)] = 1;
}
// $return = array_keys( $final_parent_refresh );
$return = $final_parent_refresh;
return $return;
}