/** * Set data and parse for properties * * @param string data The data */ public function setData($data) { static $trans; parent::setData($data); // Get the NamespacePrefix $ns = $this->getNamespacePrefix(); // Select properties which should be set foreach (array(FALSE => $this->getNode('/' . $ns . ':propertyupdate/' . $ns . ':set/' . $ns . ':prop'), TRUE => $this->getNode('/' . $ns . ':propertyupdate/' . $ns . ':remove/' . $ns . ':prop')) as $remove => $propupdate) { if (!$propupdate) { continue; } // Copied from WebdavPropFindRequest::setData() foreach ($propupdate->children as $node) { $name = $node->getName(); $ns = 'xmlns'; $nsprefix = ''; if (($p = strpos($name, ':')) !== FALSE) { $ns .= ':' . ($nsprefix = substr($name, 0, $p)); $name = substr($name, $p + 1); } $p = new WebdavProperty($name, $this->decode($node->getContent())); if ($nsname = $node->getAttribute($ns)) { $p->setNamespaceName($nsname); if ($nsprefix) { $p->setNamespacePrefix($nsprefix); } } $this->addProperty($p, $remove); } } }
/** * Set data and parse for properties * * @param string data The data */ public function setData($data) { parent::setData($data); // Set properties if (!$this->getNode('/propfind/allprop') && ($propfind = $this->getNode('/propfind/prop'))) { foreach ($propfind->children as $node) { $name = $node->getName(); $ns = 'xmlns'; $nsprefix = ''; if (($p = strpos($name, ':')) !== FALSE) { $ns .= ':' . ($nsprefix = substr($name, 0, $p)); $name = substr($name, $p + 1); } $p = new WebdavProperty($name); if ($nsname = $node->getAttribute($ns)) { $p->setNamespaceName($nsname); if ($nsprefix) { $p->setNamespacePrefix($nsprefix); } } $this->addProperty($p); } } }