예제 #1
0
	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')
		));
	}
 /**
  * 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');
 }