本文整理汇总了PHP中ArrayList::toNestedArray方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayList::toNestedArray方法的具体用法?PHP ArrayList::toNestedArray怎么用?PHP ArrayList::toNestedArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayList
的用法示例。
在下文中一共展示了ArrayList::toNestedArray方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testToNestedArray
public function testToNestedArray() {
$list = new ArrayList(array(
array('First' => 'FirstFirst', 'Second' => 'FirstSecond'),
(object) array('First' => 'SecondFirst', 'Second' => 'SecondSecond'),
new ArrayListTest_Object('ThirdFirst', 'ThirdSecond')
));
$this->assertEquals($list->toNestedArray(), array(
array('First' => 'FirstFirst', 'Second' => 'FirstSecond'),
array('First' => 'SecondFirst', 'Second' => 'SecondSecond'),
array('First' => 'ThirdFirst', 'Second' => 'ThirdSecond')
));
}
示例2: all
/**
* All public calendars
*/
function all()
{
$calendars = PublicCalendar::get();
$events = new ArrayList();
foreach ($calendars as $cal) {
$events->merge($cal->Events());
}
$eventsArr = $events->toNestedArray();
//Debug::dump($eventsArr);
//return false;
$ics = new ICSExport($eventsArr);
return $this->output($ics, 'all');
}