MediaWiki REL1_28
PPNode_Hash_Tree Class Reference
Inheritance diagram for PPNode_Hash_Tree:
Collaboration diagram for PPNode_Hash_Tree:

Public Member Functions

 __construct (array $store, $index)
 Construct an object using the data from $store[$index].
 
 __toString ()
 Convert a node to XML, for debugging.
 
 getChildren ()
 
 getChildrenOfType ( $name)
 Get an array of the children with a given node name.
 
 getFirstChild ()
 Get the first child, or false if there is none.
 
 getLength ()
 
 getName ()
 
 getNextSibling ()
 Get the next sibling, or false if there is none.
 
 getRawChildren ()
 Get the raw child array.
 
 item ( $i)
 
 splitArg ()
 Split a "<part>" node into an associative array containing:
 
 splitExt ()
 Split an "<ext>" node into an associative array containing name, attr, inner and close All values in the resulting array are PPNodes.
 
 splitHeading ()
 Split an "<h>" node.
 
 splitTemplate ()
 Split a "<template>" or "<tplarg>" node.
 

Static Public Member Functions

static factory (array $store, $index)
 Construct an appropriate PPNode_Hash_* object with a class that depends on what is at the relevant store index.
 
static splitRawArg (array $children)
 Like splitArg() but for a raw child array.
 
static splitRawExt (array $children)
 Like splitExt() but for a raw child array.
 
static splitRawHeading (array $children)
 Like splitHeading() but for a raw child array.
 
static splitRawTemplate (array $children)
 Like splitTemplate() but for a raw child array.
 

Public Attributes

 $name
 
const CHILDREN = 1
 The offset of the child list within descriptors, used in some places for readability.
 
const NAME = 0
 The offset of the name within descriptors, used in some places for readability.
 

Private Attributes

 $index
 The index into $this->store which contains the descriptor of this node.
 
 $rawChildren
 The store array for children of this node.
 
 $store
 The store array for the siblings of this node, including this node itself.
 

Detailed Description

Definition at line 1623 of file Preprocessor_Hash.php.

Constructor & Destructor Documentation

◆ __construct()

PPNode_Hash_Tree::__construct ( array  $store,
  $index 
)

Construct an object using the data from $store[$index].

The rest of the store array can be accessed via getNextSibling().

Parameters
array$store
integer$index

Definition at line 1664 of file Preprocessor_Hash.php.

References $index, $store, list, name, and store.

Member Function Documentation

◆ __toString()

PPNode_Hash_Tree::__toString ( )

Convert a node to XML, for debugging.

Definition at line 1701 of file Preprocessor_Hash.php.

References $attribs, and getFirstChild().

◆ factory()

static PPNode_Hash_Tree::factory ( array  $store,
  $index 
)
static

Construct an appropriate PPNode_Hash_* object with a class that depends on what is at the relevant store index.

Parameters
array$store
integer$index
Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text

Definition at line 1678 of file Preprocessor_Hash.php.

References $index, and $store.

Referenced by getChildren(), getChildrenOfType(), getFirstChild(), getNextSibling(), PPNode_Hash_Text\getNextSibling(), and PPNode_Hash_Attr\getNextSibling().

◆ getChildren()

PPNode_Hash_Tree::getChildren ( )
Returns
PPNode_Hash_Array

Implements PPNode.

Definition at line 1721 of file Preprocessor_Hash.php.

References as, and factory().

◆ getChildrenOfType()

PPNode_Hash_Tree::getChildrenOfType (   $name)

Get an array of the children with a given node name.

Parameters
string$name
Returns
PPNode_Hash_Array

Implements PPNode.

Definition at line 1761 of file Preprocessor_Hash.php.

References $name, as, and factory().

◆ getFirstChild()

PPNode_Hash_Tree::getFirstChild ( )

Get the first child, or false if there is none.

Note that this will return a temporary proxy object: different instances will be returned if this is called more than once on the same node.

Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean

Implements PPNode.

Definition at line 1736 of file Preprocessor_Hash.php.

References factory().

Referenced by __toString().

◆ getLength()

PPNode_Hash_Tree::getLength ( )
Returns
bool

Implements PPNode.

Definition at line 1782 of file Preprocessor_Hash.php.

◆ getName()

PPNode_Hash_Tree::getName ( )
Returns
string

Implements PPNode.

Definition at line 1797 of file Preprocessor_Hash.php.

References $name.

◆ getNextSibling()

PPNode_Hash_Tree::getNextSibling ( )

Get the next sibling, or false if there is none.

Note that this will return a temporary proxy object: different instances will be returned if this is called more than once on the same node.

Returns
PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|boolean

Implements PPNode.

Definition at line 1751 of file Preprocessor_Hash.php.

References factory(), and store.

◆ getRawChildren()

PPNode_Hash_Tree::getRawChildren ( )

Get the raw child array.

For internal use.

Returns
array

Definition at line 1775 of file Preprocessor_Hash.php.

References $rawChildren.

◆ item()

PPNode_Hash_Tree::item (   $i)
Parameters
int$i
Returns
bool

Implements PPNode.

Definition at line 1790 of file Preprocessor_Hash.php.

◆ splitArg()

PPNode_Hash_Tree::splitArg ( )

Split a "<part>" node into an associative array containing:

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1810 of file Preprocessor_Hash.php.

References splitRawArg().

◆ splitExt()

PPNode_Hash_Tree::splitExt ( )

Split an "<ext>" node into an associative array containing name, attr, inner and close All values in the resulting array are PPNodes.

Inner and close are optional.

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1851 of file Preprocessor_Hash.php.

References splitRawExt().

◆ splitHeading()

PPNode_Hash_Tree::splitHeading ( )

Split an "<h>" node.

Exceptions
MWException
Returns
array

Implements PPNode.

Definition at line 1891 of file Preprocessor_Hash.php.

References name, and splitRawHeading().

◆ splitRawArg()

static PPNode_Hash_Tree::splitRawArg ( array  $children)
static

Like splitArg() but for a raw child array.

For internal use only.

Definition at line 1817 of file Preprocessor_Hash.php.

References as, CHILDREN, and NAME.

Referenced by splitArg().

◆ splitRawExt()

static PPNode_Hash_Tree::splitRawExt ( array  $children)
static

Like splitExt() but for a raw child array.

For internal use only.

Definition at line 1858 of file Preprocessor_Hash.php.

References as.

Referenced by PPFrame_Hash\expand(), and splitExt().

◆ splitRawHeading()

static PPNode_Hash_Tree::splitRawHeading ( array  $children)
static

Like splitHeading() but for a raw child array.

For internal use only.

Definition at line 1901 of file Preprocessor_Hash.php.

References as, and CHILDREN.

Referenced by PPFrame_Hash\expand(), and splitHeading().

◆ splitRawTemplate()

static PPNode_Hash_Tree::splitRawTemplate ( array  $children)
static

Like splitTemplate() but for a raw child array.

For internal use only.

Definition at line 1932 of file Preprocessor_Hash.php.

References as.

Referenced by PPFrame_Hash\expand(), and splitTemplate().

◆ splitTemplate()

PPNode_Hash_Tree::splitTemplate ( )

Split a "<template>" or "<tplarg>" node.

Exceptions
MWException
Returns
array

Definition at line 1925 of file Preprocessor_Hash.php.

References splitRawTemplate().

Member Data Documentation

◆ $index

PPNode_Hash_Tree::$index
private

The index into $this->store which contains the descriptor of this node.

Definition at line 1643 of file Preprocessor_Hash.php.

Referenced by __construct(), and factory().

◆ $name

PPNode_Hash_Tree::$name

Definition at line 1626 of file Preprocessor_Hash.php.

Referenced by getChildrenOfType(), and getName().

◆ $rawChildren

PPNode_Hash_Tree::$rawChildren
private

The store array for children of this node.

It is "raw" in the sense that nodes are two-element arrays ("descriptors") rather than PPNode_Hash_* objects.

Definition at line 1633 of file Preprocessor_Hash.php.

Referenced by getRawChildren().

◆ $store

PPNode_Hash_Tree::$store
private

The store array for the siblings of this node, including this node itself.

Definition at line 1638 of file Preprocessor_Hash.php.

Referenced by __construct(), and factory().

◆ CHILDREN

const PPNode_Hash_Tree::CHILDREN = 1

The offset of the child list within descriptors, used in some places for readability.

Definition at line 1655 of file Preprocessor_Hash.php.

Referenced by PPNode_Hash_Attr\__construct(), splitRawArg(), and splitRawHeading().

◆ NAME

const PPNode_Hash_Tree::NAME = 0

The offset of the name within descriptors, used in some places for readability.

Definition at line 1649 of file Preprocessor_Hash.php.

Referenced by PPNode_Hash_Attr\__construct(), Preprocessor_Hash\preprocessToObj(), and splitRawArg().


The documentation for this class was generated from the following file: