本文整理匯總了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;
}
}
}