/**
* 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())
{
if (!($root = $helper->findNode('/' . $name))) {
throw new Horde_Kolab_Format_Exception_InvalidRoot(sprintf('Missing root node "%s"!', $name));
}
$attributes['_format-version'] = $root->getAttribute('version');
$attributes['_api-version'] = $params['api-version'];
if (!$this->isRelaxed($params)) {
if (version_compare($params['expected-version'], $attributes['_format-version']) < 0) {
throw new Horde_Kolab_Format_Exception_InvalidRoot(sprintf('Not attempting to read higher root version of %s with our version %s!', $attributes['_format-version'], $params['expected-version']));
}
}
$this->_prepareCompositeParameters($params, $attributes['_format-version']);
parent::load($name, $attributes, $parent_node, $helper, $params);
return $root;
}