本文整理汇总了PHP中DateTimeUtil::getHashList方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeUtil::getHashList方法的具体用法?PHP DateTimeUtil::getHashList怎么用?PHP DateTimeUtil::getHashList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeUtil
的用法示例。
在下文中一共展示了DateTimeUtil::getHashList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_activities
function add_activities($user, $type = 'sugar')
{
if ($this->view == 'week' || $this->view == 'shared') {
$end_date_time = $this->date_time->get_first_day_of_next_week();
} else {
$end_date_time = $this->date_time;
}
$acts_arr = array();
if ($type == 'vfb') {
$acts_arr = CalendarActivity::get_freebusy_activities($user, $this->date_time, $end_date_time);
} else {
$acts_arr = CalendarActivity::get_activities($user->id, $this->show_tasks, $this->date_time, $end_date_time, $this->view);
}
// loop thru each activity for this user
for ($i = 0; $i < count($acts_arr); $i++) {
$act = $acts_arr[$i];
// get "hashed" time slots for the current activity we are looping through
$hash_list = DateTimeUtil::getHashList($this->view, $act->start_time, $act->end_time);
for ($j = 0; $j < count($hash_list); $j++) {
if (!isset($this->slice_hash[$hash_list[$j]]) || !isset($this->slice_hash[$hash_list[$j]]->acts_arr[$user->id])) {
$this->slice_hash[$hash_list[$j]]->acts_arr[$user->id] = array();
}
$this->slice_hash[$hash_list[$j]]->acts_arr[$user->id][] = $act;
}
}
}