Ical = new IcalLib(); } /** * IcalHelper::reset() * * @return void */ public function reset() { $this->$_data = []; } /** * Add a new ical record. * * @return bool Success */ public function add($data = []) { //TODO: validate! $this->_data[] = $data; return true; } /** * Returns complete ical calender file content to output. * * @return string */ public function generate($globalData = [], $addStartAndEnd = true) { $res = []; 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; } }