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.
コード例 #1
0
ファイル: Uid.php プロジェクト: raz0rsdge/horde
 /**
  * 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 && !$this->isRelaxed($params)) {
         throw new Horde_Kolab_Format_Exception_MissingUid();
     }
     return $result;
 }
コード例 #2
0
ファイル: AutomaticDate.php プロジェクト: raz0rsdge/horde
 /**
  * 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) {
         return $result;
     } else {
         $attributes[$name] = new DateTime();
     }
 }
コード例 #3
0
ファイル: String.php プロジェクト: raz0rsdge/horde
 /**
  * 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) {
         return $result;
     } else {
         if ($this->value != Horde_Kolab_Format_Xml::VALUE_MAYBE_MISSING) {
             $attributes[$name] = $this->loadMissing($name, $params);
         }
         return false;
     }
 }
コード例 #4
0
ファイル: PrefsApplication.php プロジェクト: raz0rsdge/horde
 /**
  * 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) {
         $result = parent::load('categories', $attributes, $parent_node, $helper, $params);
     }
     if ($result !== false && ($value = $this->loadNodeValue($result, $helper, $params)) !== null) {
         $attributes[$name] = $value;
         return $result;
     } else {
         if (!$this->isRelaxed($params)) {
             throw new Horde_Kolab_Format_Exception_MissingValue('Preferences XML object is missing an application setting.');
         } else {
             return false;
         }
     }
 }