Horde_Pear_Package_Xml_Element_Directory::delete PHP Method

delete() public method

Remove the directory entry from the XML.
public delete ( ) : null
return null
    public function delete()
    {
        $dir = $this->getDirectoryNode();
        $this->_xml->removeWhitespace($dir->nextSibling);
        $this->_xml->removeComment($dir->nextSibling, $this->_path);
        $this->_xml->removeWhitespace($dir->nextSibling);
        $dir->parentNode->removeChild($dir);
    }

Usage Example

Example #1
0
 /**
  * Prune this directory if it is empty.
  *
  * @return NULL
  */
 private function _prune()
 {
     if (empty($this->_files) && empty($this->_subdirectories)) {
         $this->_element->delete();
         if ($this->_parent instanceof Horde_Pear_Package_Xml_Directory) {
             $this->_parent->_deleteSubdirectory($this->_element->getName());
         }
     }
 }