Ical = new IcalLib(); } /** * IcalHelper::reset() * * @return void */ public function reset() { $this->$_data = array(); } /** * Add a new ical record. * * @return boolean Success */ public function add($data = array()) { //TODO: validate! $this->_data[] = $data; return true; } /** * Returns complete ical calender file content to output. * * @return string * 2011-10-10 ms */ public function generate($globalData = array(), $addStartAndEnd = true) { $res = array(); foreach ($this->_data as $data) { $res[] = $this->Ical->build($data); } $res = implode(PHP_EOL.PHP_EOL, $res); if ($addStartAndEnd) { $res = $this->Ical->createStart($globalData).PHP_EOL.PHP_EOL.$res.PHP_EOL.PHP_EOL.$this->Ical->createEnd(); } return $res; } }