Overview

Packages

  • Kolab
    • Format

Classes

  • Horde_Kolab_Format_Date
  • Horde_Kolab_Format_Decorator_Base
  • Horde_Kolab_Format_Decorator_Memory
  • Horde_Kolab_Format_Decorator_Timed
  • Horde_Kolab_Format_Exception
  • Horde_Kolab_Format_Exception_InvalidRoot
  • Horde_Kolab_Format_Exception_MissingUid
  • Horde_Kolab_Format_Exception_MissingValue
  • Horde_Kolab_Format_Exception_ParseError
  • Horde_Kolab_Format_Factory
  • Horde_Kolab_Format_Xml
  • Horde_Kolab_Format_Xml_Annotation
  • Horde_Kolab_Format_Xml_Contact
  • Horde_Kolab_Format_Xml_Distributionlist
  • Horde_Kolab_Format_Xml_Envelope
  • Horde_Kolab_Format_Xml_Event
  • Horde_Kolab_Format_Xml_Helper
  • Horde_Kolab_Format_Xml_Hprefs
  • Horde_Kolab_Format_Xml_Note
  • Horde_Kolab_Format_Xml_Parser
  • Horde_Kolab_Format_Xml_Task
  • Horde_Kolab_Format_Xml_Type_AddressType
  • Horde_Kolab_Format_Xml_Type_AttendeeRole
  • Horde_Kolab_Format_Xml_Type_AttendeeStatus
  • Horde_Kolab_Format_Xml_Type_AutomaticDate
  • Horde_Kolab_Format_Xml_Type_AutomaticDate_V1
  • Horde_Kolab_Format_Xml_Type_Base
  • Horde_Kolab_Format_Xml_Type_Boolean
  • Horde_Kolab_Format_Xml_Type_Boolean_True
  • Horde_Kolab_Format_Xml_Type_Color
  • Horde_Kolab_Format_Xml_Type_Color_Background
  • Horde_Kolab_Format_Xml_Type_Color_Foreground
  • Horde_Kolab_Format_Xml_Type_Composite
  • Horde_Kolab_Format_Xml_Type_Composite_Address
  • Horde_Kolab_Format_Xml_Type_Composite_Attendee
  • Horde_Kolab_Format_Xml_Type_Composite_Name
  • Horde_Kolab_Format_Xml_Type_Composite_Phone
  • Horde_Kolab_Format_Xml_Type_Composite_Recurrence
  • Horde_Kolab_Format_Xml_Type_Composite_Recurrence_V1
  • Horde_Kolab_Format_Xml_Type_Composite_SimplePerson
  • Horde_Kolab_Format_Xml_Type_CreationDate
  • Horde_Kolab_Format_Xml_Type_CreationDate_V1
  • Horde_Kolab_Format_Xml_Type_Date
  • Horde_Kolab_Format_Xml_Type_Date_V1
  • Horde_Kolab_Format_Xml_Type_DateTime
  • Horde_Kolab_Format_Xml_Type_DateTime_V1
  • Horde_Kolab_Format_Xml_Type_EventDate
  • Horde_Kolab_Format_Xml_Type_EventDate_V1
  • Horde_Kolab_Format_Xml_Type_Integer
  • Horde_Kolab_Format_Xml_Type_ModificationDate
  • Horde_Kolab_Format_Xml_Type_Multiple
  • Horde_Kolab_Format_Xml_Type_Multiple_Address
  • Horde_Kolab_Format_Xml_Type_Multiple_Attendee
  • Horde_Kolab_Format_Xml_Type_Multiple_Boolean
  • Horde_Kolab_Format_Xml_Type_Multiple_Date
  • Horde_Kolab_Format_Xml_Type_Multiple_Phone
  • Horde_Kolab_Format_Xml_Type_Multiple_SimplePerson
  • Horde_Kolab_Format_Xml_Type_Multiple_String
  • Horde_Kolab_Format_Xml_Type_PhoneType
  • Horde_Kolab_Format_Xml_Type_PrefsApplication
  • Horde_Kolab_Format_Xml_Type_ProductId
  • Horde_Kolab_Format_Xml_Type_RecurrenceInterval
  • Horde_Kolab_Format_Xml_Type_RecurrenceRange
  • Horde_Kolab_Format_Xml_Type_RecurrenceRange_V1
  • Horde_Kolab_Format_Xml_Type_Root
  • Horde_Kolab_Format_Xml_Type_Sensitivity
  • Horde_Kolab_Format_Xml_Type_String
  • Horde_Kolab_Format_Xml_Type_String_Empty
  • Horde_Kolab_Format_Xml_Type_String_MaybeMissing
  • Horde_Kolab_Format_Xml_Type_TaskCompletion
  • Horde_Kolab_Format_Xml_Type_TaskPriority
  • Horde_Kolab_Format_Xml_Type_TaskStatus
  • Horde_Kolab_Format_Xml_Type_Uid
  • Horde_Kolab_Format_Xml_Type_XmlAppend

Interfaces

  • Horde_Kolab_Format
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Handles api version 1 of the recurrence range attribute.
  4:  *
  5:  * PHP version 5
  6:  *
  7:  * @category Kolab
  8:  * @package  Kolab_Format
  9:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 10:  * @license  http://www.horde.org/licenses/lgpl21 LGPL
 11:  * @link     http://www.horde.org/libraries/Horde_Kolab_Format
 12:  */
 13: 
 14: /**
 15:  * Handles api version 1 of the recurrence range attribute.
 16:  *
 17:  * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
 18:  *
 19:  * See the enclosed file COPYING for license information (LGPL). If you did not
 20:  * receive this file, see
 21:  * http://www.horde.org/licenses/lgpl21.
 22:  *
 23:  * @since Horde_Kolab_Format 1.1.0
 24:  *
 25:  * @category Kolab
 26:  * @package  Kolab_Format
 27:  * @author   Gunnar Wrobel <wrobel@pardus.de>
 28:  * @license  http://www.horde.org/licenses/lgpl21 LGPL
 29:  * @link     http://www.horde.org/libraries/Horde_Kolab_Format
 30:  */
 31: class Horde_Kolab_Format_Xml_Type_RecurrenceRange_V1
 32: extends Horde_Kolab_Format_Xml_Type_String
 33: {
 34:     /**
 35:      * Load the node value from the Kolab object.
 36:      *
 37:      * @param string                        $name        The name of the the
 38:      *                                                   attribute to be fetched.
 39:      * @param array                         &$attributes The data array that
 40:      *                                                   holds all attribute
 41:      *                                                   values.
 42:      * @param DOMNode                       $parent_node The parent node of the
 43:      *                                                   node to be loaded.
 44:      * @param Horde_Kolab_Format_Xml_Helper $helper      A XML helper instance.
 45:      * @param array                         $params      Additiona parameters for
 46:      *                                                   this parse operation.
 47:      *
 48:      * @return DOMNode|boolean The named DOMNode or false if no node value was
 49:      *                         found.
 50:      */
 51:     public function load(
 52:         $name,
 53:         &$attributes,
 54:         $parent_node,
 55:         Horde_Kolab_Format_Xml_Helper $helper,
 56:         $params = array()
 57:     )
 58:     {
 59:         $result = parent::load($name, $attributes, $parent_node, $helper, $params);
 60:         if ($result !== false) {
 61:             $type = $result->getAttribute('type');
 62:             if (!empty($type) && $type != 'none') {
 63:                 $attributes['range-type'] = $type;
 64:             }
 65:         }
 66:         return $result;
 67:     }
 68: 
 69:     /**
 70:      * Load the value of a node.
 71:      *
 72:      * @param DOMNode                       $node   Retrieve value for this node.
 73:      * @param Horde_Kolab_Format_Xml_Helper $helper A XML helper instance.
 74:      * @param array                         $params Additiona parameters for
 75:      *                                              this parse operation.
 76:      *
 77:      * @return mixed|null The value or null if no value was found.
 78:      */
 79:     public function loadNodeValue(
 80:         $node,
 81:         Horde_Kolab_Format_Xml_Helper $helper,
 82:         $params = array()
 83:     )
 84:     {
 85:         $result = $helper->fetchNodeValue($node);
 86:         $type = $node->getAttribute('type');
 87:         if (empty($type) || $type == 'none') {
 88:             return null;
 89:         }
 90:         if ($type == 'date') {
 91:             return Horde_Kolab_Format_Date::decodeDate($result);
 92:         }
 93:         return $result;
 94:     }
 95: 
 96:     /**
 97:      * Update the specified attribute.
 98:      *
 99:      * @param string                        $name        The name of the the
100:      *                                                   attribute to be updated.
101:      * @param array                         $attributes  The data array that holds
102:      *                                                   all attribute values.
103:      * @param DOMNode                       $parent_node The parent node of the
104:      *                                                   node that should be
105:      *                                                   updated.
106:      * @param Horde_Kolab_Format_Xml_Helper $helper      A XML helper instance.
107:      * @param array                         $params      Additional parameters
108:      *                                                   for this write operation.
109:      *
110:      * @return DOMNode|boolean The new/updated child node or false if this
111:      *                         failed.
112:      *
113:      * @throws Horde_Kolab_Format_Exception If converting the data to XML failed.
114:      */
115:     public function save(
116:         $name,
117:         $attributes,
118:         $parent_node,
119:         Horde_Kolab_Format_Xml_Helper $helper,
120:         $params = array()
121:     )
122:     {
123:         if (isset($attributes['range-type']) &&
124:             $attributes['range-type'] == 'date') {
125:             $attributes[$name] = Horde_Kolab_Format_Date::encodeDate($attributes[$name]);
126:         }
127:         $node = parent::save(
128:             $name, $attributes, $parent_node, $helper, $params
129:         );
130:         if (isset($attributes['range-type'])) {
131:             $type = $attributes['range-type'];
132:         } else {
133:             $type = 'none';
134:         }
135:         $node->setAttribute('type', $type);
136:     }
137: }
138: 
API documentation generated by ApiGen