More calendar properties.
authorJan Schneider <jan@horde.org>
Thu, 10 Sep 2009 22:41:57 +0000 (00:41 +0200)
committerJan Schneider <jan@horde.org>
Mon, 14 Sep 2009 16:34:12 +0000 (18:34 +0200)
framework/Icalendar/lib/Horde/Icalendar/Vcalendar.php

index 3416113..5092a9b 100644 (file)
@@ -5,12 +5,22 @@ class Horde_Icalendar_Vcalendar extends Horde_Icalendar_Base
     public function __construct($properties = array())
     {
         $this->_properties += array(
-            'version' => array('required' => true,
+            // RFC 2445 Section 4.7.1
+            'scale' => array('required' => false,
+                             'multiple' => false,
+                             'type' => 'string'),
+            // RFC 2445 Section 4.7.2
+            'method' => array('required' => false,
+                              'multiple' => false,
+                              'type' => 'string'),
+            // RFC 2445 Section 4.7.3
+            'product' => array('required' => true,
                                'multiple' => false,
                                'type' => 'string'),
-            'product' => array('required' => true,
+            // RFC 2445 Section 4.7.4
+            'version' => array('required' => true,
                                'multiple' => false,
-                               'type' => 'string')
+                               'type' => 'string'),
         );
 
         $properties = array_merge(array('version' => '2.0',
@@ -19,4 +29,18 @@ class Horde_Icalendar_Vcalendar extends Horde_Icalendar_Base
         parent::__construct($properties);
     }
 
+    /**
+     * Getter.
+     *
+     * @throws InvalidArgumentException
+     */
+    public function __get($property)
+    {
+        $value = parent::__get($property);
+        if ($property == 'scale' && is_null($value)) {
+            $value = 'GREGORIAN';
+        }
+        return $value;
+    }
+
 }