\Horde_Pear_Package_Xml_Element_Directory

Handles a XML directory node in the contents list.

Summary

Methods
Properties
Constants
__construct()
setDocument()
getDocument()
setDirectoryNode()
getDirectoryNode()
getName()
getLevel()
getPath()
getSubdirectories()
getFiles()
insertFile()
insertSubDirectory()
insert()
delete()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$_xml
$_dir
$_name
$_path
$_level
N/A

Properties

$_dir

$_dir : \DOMNode

The directory node.

Type

\DOMNode

$_name

$_name : string

The name of this directory.

Type

string

$_path

$_path : string

The path to this directory.

Type

string

$_level

$_level : integer

The level in the tree.

Type

integer

Methods

__construct()

__construct(string  $name, \Horde_Pear_Package_Xml_Element_Directory  $parent = null) 

Constructor.

Parameters

string $name

The name of the directory.

\Horde_Pear_Package_Xml_Element_Directory $parent

The parent directory.

setDocument()

setDocument(\Horde_Pear_Package_Xml  $xml) : NULL

Set the package.xml handler to operate on.

Parameters

\Horde_Pear_Package_Xml $xml

The XML handler.

Returns

NULL

getDocument()

getDocument() : \Horde_Pear_Package_Xml

Return the package.xml handler this element belongs to.

Returns

\Horde_Pear_Package_Xml

The XML handler.

setDirectoryNode()

setDirectoryNode(\DOMNode  $directory) : NULL

Set the DOM node of the directory entry.

Parameters

\DOMNode $directory

The directory node.

Returns

NULL

getDirectoryNode()

getDirectoryNode() : \DOMNode

Get the DOM node of the directory entry.

Returns

\DOMNode —

The directory node.

getName()

getName() : string

Return the name of this directory.

Returns

string —

The directory name.

getLevel()

getLevel() : integer

Return the level of depth in the tree for this directory.

Returns

integer —

The level.

getPath()

getPath() : string

Return the full path to this element.

Returns

string —

The path.

getSubdirectories()

getSubdirectories() : array

Return the subdirectories for this directory.

Returns

array —

The list of subdirectories.

getFiles()

getFiles() : array

Return the list of files in this directory.

Returns

array —

The list of files.

insertFile()

insertFile(string  $name, string  $role, \DOMNode  $point = null, array  $replace = array()) : \Horde_Pear_Package_Xml_Element_File

Insert a new file entry into the XML at the given point with the specified name and file role.

Parameters

string $name

The name.

string $role

The role.

\DOMNode $point

Insertion point.

array $replace

Replacement tasks.

Returns

\Horde_Pear_Package_Xml_Element_File

The inserted element.

insertSubDirectory()

insertSubDirectory(string  $name, \DOMNode  $point = null) : \Horde_Pear_Package_Xml_Element_Directory

Insert a new directory entry into the XML at the given point with the specified name

Parameters

string $name

The name.

\DOMNode $point

Insertion point.

Returns

\Horde_Pear_Package_Xml_Element_Directory

The inserted element.

insert()

insert(\Horde_Pear_Package_Xml_Element_Directory  $parent, \DOMNode  $point = null) : NULL

Insert the directory entry into the XML at the given point.

Parameters

\Horde_Pear_Package_Xml_Element_Directory $parent

The parent.

\DOMNode $point

Insertion point.

Returns

NULL

delete()

delete() : NULL

Remove the directory entry from the XML.

Returns

NULL