interface Doctrine_Node_Interface (View source)

Doctrine_Node_Interface

Methods

bool
hasPrevSibling()

test if node has previous sibling

bool
hasNextSibling()

test if node has next sibling

bool
hasChildren()

test if node has children

bool
hasParent()

test if node has parent

getPrevSibling()

gets record of prev sibling or empty record

getNextSibling()

gets record of next sibling or empty record

array
getSiblings($includeNode = false)

gets siblings for node

getFirstChild()

gets record of first child or empty record

getLastChild()

gets record of last child or empty record

array
getChildren()

gets children for node (direct descendants only)

getDescendants()

gets descendants for node (direct descendants only)

getParent()

gets record of parent or empty record

getAncestors()

gets ancestors for node

string
getPath(string $seperator = ' > ', bool $includeNode = false)

gets path to node from root, uses record::toString() method to get node names

int
getLevel()

gets level (depth) of node in the tree

int
getNumberChildren()

gets number of children (direct descendants)

int
getNumberDescendants()

gets number of descendants (children and their children)

bool
insertAsParentOf(Doctrine_Record $dest)

inserts node as parent of dest record

bool
insertAsPrevSiblingOf(Doctrine_Record $dest)

inserts node as previous sibling of dest record

bool
insertAsNextSiblingOf(Doctrine_Record $dest)

inserts node as next sibling of dest record

bool
insertAsFirstChildOf(Doctrine_Record $dest)

inserts node as first child of dest record

bool
insertAsLastChildOf(Doctrine_Record $dest)

inserts node as first child of dest record

moveAsPrevSiblingOf(Doctrine_Record $dest)

moves node as prev sibling of dest record

moveAsNextSiblingOf(Doctrine_Record $dest)

moves node as next sibling of dest record

moveAsFirstChildOf(Doctrine_Record $dest)

moves node as first child of dest record

moveAsLastChildOf(Doctrine_Record $dest)

moves node as last child of dest record

addChild(Doctrine_Record $record)

adds node as last child of record

bool
isLeaf()

determines if node is leaf

bool
isRoot()

determines if node is root

bool
isEqualTo(Doctrine_Record $subj)

determines if node is equal to subject node

bool
isDescendantOf(Doctrine_Record $subj)

determines if node is child of subject node

bool
isDescendantOfOrEqualTo(Doctrine_Record $subj)

determines if node is child of or sibling to subject node

bool
isValidNode()

determines if node is valid

delete()

deletes node and it's descendants

Details

bool hasPrevSibling()

test if node has previous sibling

Return Value

bool

bool hasNextSibling()

test if node has next sibling

Return Value

bool

bool hasChildren()

test if node has children

Return Value

bool

bool hasParent()

test if node has parent

Return Value

bool

Doctrine_Record getPrevSibling()

gets record of prev sibling or empty record

Return Value

Doctrine_Record

Doctrine_Record getNextSibling()

gets record of next sibling or empty record

Return Value

Doctrine_Record

array getSiblings($includeNode = false)

gets siblings for node

Parameters

$includeNode

Return Value

array array of sibling Doctrine_Record objects

Doctrine_Record getFirstChild()

gets record of first child or empty record

Return Value

Doctrine_Record

Doctrine_Record getLastChild()

gets record of last child or empty record

Return Value

Doctrine_Record

array getChildren()

gets children for node (direct descendants only)

Return Value

array array of sibling Doctrine_Record objects

Iterator getDescendants()

gets descendants for node (direct descendants only)

Return Value

Iterator iterator to traverse descendants from node

Doctrine_Record getParent()

gets record of parent or empty record

Return Value

Doctrine_Record

Doctrine_Collection getAncestors()

gets ancestors for node

Return Value

Doctrine_Collection

string getPath(string $seperator = ' > ', bool $includeNode = false)

gets path to node from root, uses record::toString() method to get node names

Parameters

string $seperator path seperator
bool $includeNode whether or not to include node at end of path

Return Value

string string representation of path

int getLevel()

gets level (depth) of node in the tree

Return Value

int

int getNumberChildren()

gets number of children (direct descendants)

Return Value

int

int getNumberDescendants()

gets number of descendants (children and their children)

Return Value

int

bool insertAsParentOf(Doctrine_Record $dest)

inserts node as parent of dest record

Parameters

Doctrine_Record $dest

Return Value

bool

bool insertAsPrevSiblingOf(Doctrine_Record $dest)

inserts node as previous sibling of dest record

Parameters

Doctrine_Record $dest

Return Value

bool

bool insertAsNextSiblingOf(Doctrine_Record $dest)

inserts node as next sibling of dest record

Parameters

Doctrine_Record $dest

Return Value

bool

bool insertAsFirstChildOf(Doctrine_Record $dest)

inserts node as first child of dest record

Parameters

Doctrine_Record $dest

Return Value

bool

bool insertAsLastChildOf(Doctrine_Record $dest)

inserts node as first child of dest record

Parameters

Doctrine_Record $dest

Return Value

bool

moveAsPrevSiblingOf(Doctrine_Record $dest)

moves node as prev sibling of dest record

Parameters

Doctrine_Record $dest

moveAsNextSiblingOf(Doctrine_Record $dest)

moves node as next sibling of dest record

Parameters

Doctrine_Record $dest

moveAsFirstChildOf(Doctrine_Record $dest)

moves node as first child of dest record

Parameters

Doctrine_Record $dest

moveAsLastChildOf(Doctrine_Record $dest)

moves node as last child of dest record

Parameters

Doctrine_Record $dest

addChild(Doctrine_Record $record)

adds node as last child of record

Parameters

Doctrine_Record $record

bool isLeaf()

determines if node is leaf

Return Value

bool

bool isRoot()

determines if node is root

Return Value

bool

bool isEqualTo(Doctrine_Record $subj)

determines if node is equal to subject node

Parameters

Doctrine_Record $subj

Return Value

bool

bool isDescendantOf(Doctrine_Record $subj)

determines if node is child of subject node

Parameters

Doctrine_Record $subj

Return Value

bool

bool isDescendantOfOrEqualTo(Doctrine_Record $subj)

determines if node is child of or sibling to subject node

Parameters

Doctrine_Record $subj

Return Value

bool

bool isValidNode()

determines if node is valid

Return Value

bool

delete()

deletes node and it's descendants