/** * Intersects between two property storages. * * Calculate and return an instance of {@link * ezcWebdavBasicPropertyStorage} which contains the intersection of two * property storages. This means a new property storage will be return * which contains all values, which are present in the current and the * given $properties property storage. * * @param ezcWebdavPropertyStorage $properties * @return ezcWebdavBasicPropertyStorage */ public function intersect(ezcWebdavPropertyStorage $properties) { $foreign = $properties->getAllProperties(); $intersection = new ezcWebdavBasicPropertyStorage(); foreach ($this->properties as $namespace => $properties) { foreach ($properties as $name => $property) { if (isset($foreign[$namespace][$name])) { // Only add properties to new property storage, which could // be found in both property storages. $intersection->attach($property); } } } return $intersection; }
/** * Resets the property storage for a resource. * * Discardes the current {@link ezcWebdavPropertyStorage} of the resource * identified by $path and replaces it with the given $properties. * * @param string $path * @param ezcWebdavPropertyStorage $properties * @return bool */ public function resetProperties($path, ezcWebdavPropertyStorage $properties) { $metaStore = $this->getMetastore(); if ($metaStore == false) { return true; } $metaStore->removeMetadata(new AJXP_Node($this->getAccessDriver()->getRessourceUrl($this->fixPath($path))), "ezcWEBDAV", false, AJXP_METADATA_SCOPE_GLOBAL); AJXP_Logger::debug("DAVLOCK Clearing properties"); if ($properties != null) { foreach ($properties->getAllProperties() as $pName => $property) { $this->setProperty($path, $property); } } return true; }