Horde_Kolab_Format_Xml_Type_String::load PHP Method

load() public method

Load the node value from the Kolab object.
public load ( string $name, &$attributes, DOMNode $parent_node, Horde_Kolab_Format_Xml_Helper $helper, array $params = [] ) : DOMNode | boolean
$name string The name of the the attribute to be fetched.
$parent_node DOMNode The parent node of the node to be loaded.
$helper Horde_Kolab_Format_Xml_Helper A XML helper instance.
$params array Additiona parameters for this parse operation.
return DOMNode | boolean The named DOMNode or false if no node value was found.
    public function load($name, &$attributes, $parent_node, Horde_Kolab_Format_Xml_Helper $helper, $params = array())
    {
        $result = parent::load($name, $attributes, $parent_node, $helper, $params);
        if ($result !== false) {
            return $result;
        } else {
            if ($this->value != Horde_Kolab_Format_Xml::VALUE_MAYBE_MISSING) {
                $attributes[$name] = $this->loadMissing($name, $params);
            }
            return false;
        }
    }

Usage Example

Example #1
0
 /**
  * Load the node value from the Kolab object.
  *
  * @param string                        $name        The name of the the
  *                                                   attribute to be fetched.
  * @param array                         &$attributes The data array that
  *                                                   holds all attribute
  *                                                   values.
  * @param DOMNode                       $parent_node The parent node of the
  *                                                   node to be loaded.
  * @param Horde_Kolab_Format_Xml_Helper $helper      A XML helper instance.
  * @param array                         $params      Additiona parameters for
  *                                                   this parse operation.
  *
  * @return DOMNode|boolean The named DOMNode or false if no node value was
  *                         found.
  */
 public function load($name, &$attributes, $parent_node, Horde_Kolab_Format_Xml_Helper $helper, $params = array())
 {
     $result = parent::load($name, $attributes, $parent_node, $helper, $params);
     if ($result !== false) {
         $type = $result->getAttribute('type');
         if (!empty($type) && $type != 'none') {
             $attributes['range-type'] = $type;
         }
     }
     return $result;
 }
Horde_Kolab_Format_Xml_Type_String