From 8f215354d4274ce0fecc382c1ac1d42f63817889 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 11 Sep 2009 00:41:57 +0200 Subject: [PATCH] More calendar properties. --- .../Icalendar/lib/Horde/Icalendar/Vcalendar.php | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/framework/Icalendar/lib/Horde/Icalendar/Vcalendar.php b/framework/Icalendar/lib/Horde/Icalendar/Vcalendar.php index 341611345..5092a9b5b 100644 --- a/framework/Icalendar/lib/Horde/Icalendar/Vcalendar.php +++ b/framework/Icalendar/lib/Horde/Icalendar/Vcalendar.php @@ -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; + } + } -- 2.11.0