3
* A sample script for reading/writing an event.
8
* @package Kolab_Format
9
* @author Gunnar Wrobel <wrobel@pardus.de>
10
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
11
* @link http://www.horde.org/libraries/Horde_Kolab_Format
15
* The Autoloader allows us to omit "require/include" statements.
17
require_once 'Horde/Autoloader/Default.php';
19
/** Create the factory */
20
$factory = new Horde_Kolab_Format_Factory();
22
/** Generate the format handler */
23
$format = $factory->create('Xml', 'Event', array('version' => 1));
25
/** Prepare a test object */
28
'summary' => 'test event',
29
'start-date' => time(),
30
'end-date' => time() + 24 * 60 * 60,
33
/** Save this test data array in Kolab XML format */
34
$xml = $format->save($object);
37
/** Reload the object from the XML format */
38
$read_object = $format->load($xml);
39
var_dump($read_object);