Doctrine 1.2.4
Doctrine_Node_AdjacencyList Class Reference

Inherits Doctrine_Node, and Doctrine_Node_Interface.

Public Member Functions

 addChild (Doctrine_Record $record)
 
 delete ()
 
 getAncestors ()
 
 getChildren ()
 
 getDescendants ()
 
 getFirstChild ()
 
 getIterator ($type=null, $options=null)
 
 getLastChild ()
 
 getLevel ()
 
 getNextSibling ()
 
 getNumberChildren ()
 
 getNumberDescendants ()
 
 getParent ()
 
 getPath ($seperator= ' > ', $includeNode=false)
 
 getPrevSibling ()
 
 getRecord ()
 
 getSiblings ($includeNode=false)
 
 hasChildren ()
 
 hasNextSibling ()
 
 hasParent ()
 
 hasPrevSibling ()
 
 insertAsFirstChildOf (Doctrine_Record $dest)
 
 insertAsLastChildOf (Doctrine_Record $dest)
 
 insertAsNextSiblingOf (Doctrine_Record $dest)
 
 insertAsParentOf (Doctrine_Record $dest)
 
 insertAsPrevSiblingOf (Doctrine_Record $dest)
 
 isDescendantOf (Doctrine_Record $subj)
 
 isDescendantOfOrEqualTo (Doctrine_Record $subj)
 
 isEqualTo (Doctrine_Record $subj)
 
 isLeaf ()
 
 isRoot ()
 
 isValidNode ()
 
 moveAsFirstChildOf (Doctrine_Record $dest)
 
 moveAsLastChildOf (Doctrine_Record $dest)
 
 moveAsNextSiblingOf (Doctrine_Record $dest)
 
 moveAsPrevSiblingOf (Doctrine_Record $dest)
 
 setIteratorOptions ($options)
 
 setIteratorType ($type)
 
 setRecord (Doctrine_Record $record)
 
 traverse ($type= 'Pre', $options=array())
 

Static Public Member Functions

static factory (Doctrine_Record $record, $implName, $options=array())
 

Protected Attributes

 $iteratorOptions
 
 $iteratorType
 
 $options
 
 $record
 

Detailed Description

Definition at line 33 of file AdjacencyList.php.

Member Function Documentation

Doctrine_Node_Interface::addChild ( Doctrine_Record  $record)
inherited

adds node as last child of record

Doctrine_Node_Interface::delete ( )
inherited

deletes node and it's descendants

static Doctrine_Node::factory ( Doctrine_Record  $record,
  $implName,
  $options = array() 
)
staticinherited

Factory method for creating a Node.

This is a factory method that returns node instance based upon chosen implementation.

Parameters
object$recordinstance of Doctrine_Record
string$implNameimplementation (NestedSet, AdjacencyList, MaterializedPath)
array$optionsoptions
Returns
Doctrine_Node
Exceptions
Doctrine_Node_Exceptionif $implName is not a valid class

Definition at line 115 of file Node.php.

{
$class = 'Doctrine_Node_' . $implName;
if ( ! class_exists($class)) {
throw new Doctrine_Node_Exception("The class $class must exist and extend Doctrine_Node");
}
return new $class($record, $options);
}
Doctrine_Node_Interface::getAncestors ( )
inherited

gets ancestors for node

Returns
Doctrine_Collection
Doctrine_Node_Interface::getChildren ( )
inherited

gets children for node (direct descendants only)

Returns
array array of sibling Doctrine_Record objects
Doctrine_Node_Interface::getDescendants ( )
inherited

gets descendants for node (direct descendants only)

Returns
Iterator iterator to traverse descendants from node
Doctrine_Node_Interface::getFirstChild ( )
inherited

gets record of first child or empty record

Returns
Doctrine_Record
Doctrine_Node::getIterator (   $type = null,
  $options = null 
)
inherited

get iterator

Parameters
string$typetype of iterator (Pre | Post | Level)
array$optionsoptions

Definition at line 163 of file Node.php.

{
if ($type === null) {
$type = (isset($this->iteratorType) ? $this->iteratorType : 'Pre');
}
if ($options === null) {
$options = (isset($this->iteratorOptions) ? $this->iteratorOptions : array());
}
$implName = $this->record->getTable()->getOption('treeImpl');
$iteratorClass = 'Doctrine_Node_' . $implName . '_' . ucfirst(strtolower($type)) . 'OrderIterator';
return new $iteratorClass($this->record, $options);
}
Doctrine_Node_Interface::getLastChild ( )
inherited

gets record of last child or empty record

Returns
Doctrine_Record
Doctrine_Node_Interface::getLevel ( )
inherited

gets level (depth) of node in the tree

Returns
int
Doctrine_Node_Interface::getNextSibling ( )
inherited

gets record of next sibling or empty record

Returns
Doctrine_Record
Doctrine_Node_Interface::getNumberChildren ( )
inherited

gets number of children (direct descendants)

Returns
int
Doctrine_Node_Interface::getNumberDescendants ( )
inherited

gets number of descendants (children and their children)

Returns
int
Doctrine_Node_Interface::getParent ( )
inherited

gets record of parent or empty record

Returns
Doctrine_Record
Doctrine_Node_Interface::getPath (   $seperator = ',
,
  $includeNode = false 
)
inherited

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

Parameters
string$seperatorpath seperator
bool$includeNodewhether or not to include node at end of path
Returns
string string representation of path
Doctrine_Node_Interface::getPrevSibling ( )
inherited

gets record of prev sibling or empty record

Returns
Doctrine_Record
Doctrine_Node::getRecord ( )
inherited

getter for record attribute

Returns
Doctrine_Record

Definition at line 141 of file Node.php.

{
return $this->record;
}
Doctrine_Node_Interface::getSiblings (   $includeNode = false)
inherited

gets siblings for node

Returns
array array of sibling Doctrine_Record objects
Doctrine_Node_Interface::hasChildren ( )
inherited

test if node has children

Returns
bool
Doctrine_Node_Interface::hasNextSibling ( )
inherited

test if node has next sibling

Returns
bool
Doctrine_Node_Interface::hasParent ( )
inherited

test if node has parent

Returns
bool
Doctrine_Node_Interface::hasPrevSibling ( )
inherited

test if node has previous sibling

Returns
bool
Doctrine_Node_Interface::insertAsFirstChildOf ( Doctrine_Record  $dest)
inherited

inserts node as first child of dest record

Returns
bool
Doctrine_Node_Interface::insertAsLastChildOf ( Doctrine_Record  $dest)
inherited

inserts node as first child of dest record

Returns
bool
Doctrine_Node_Interface::insertAsNextSiblingOf ( Doctrine_Record  $dest)
inherited

inserts node as next sibling of dest record

Returns
bool
Doctrine_Node_Interface::insertAsParentOf ( Doctrine_Record  $dest)
inherited

inserts node as parent of dest record

Returns
bool
Doctrine_Node_Interface::insertAsPrevSiblingOf ( Doctrine_Record  $dest)
inherited

inserts node as previous sibling of dest record

Returns
bool
Doctrine_Node_Interface::isDescendantOf ( Doctrine_Record  $subj)
inherited

determines if node is child of subject node

Returns
bool
Doctrine_Node_Interface::isDescendantOfOrEqualTo ( Doctrine_Record  $subj)
inherited

determines if node is child of or sibling to subject node

Returns
bool
Doctrine_Node_Interface::isEqualTo ( Doctrine_Record  $subj)
inherited

determines if node is equal to subject node

Returns
bool
Doctrine_Node_Interface::isLeaf ( )
inherited

determines if node is leaf

Returns
bool
Doctrine_Node_Interface::isRoot ( )
inherited

determines if node is root

Returns
bool
Doctrine_Node_Interface::isValidNode ( )
inherited

determines if node is valid

Returns
bool
Doctrine_Node_Interface::moveAsFirstChildOf ( Doctrine_Record  $dest)
inherited

moves node as first child of dest record

Doctrine_Node_Interface::moveAsLastChildOf ( Doctrine_Record  $dest)
inherited

moves node as last child of dest record

Doctrine_Node_Interface::moveAsNextSiblingOf ( Doctrine_Record  $dest)
inherited

moves node as next sibling of dest record

Doctrine_Node_Interface::moveAsPrevSiblingOf ( Doctrine_Record  $dest)
inherited

moves node as prev sibling of dest record

Doctrine_Node::setIteratorOptions (   $options)
inherited

sets node's iterator options

Parameters
int

Definition at line 194 of file Node.php.

{
$this->iteratorOptions = $options;
}
Doctrine_Node::setIteratorType (   $type)
inherited

sets node's iterator type

Parameters
int

Definition at line 184 of file Node.php.

{
$this->iteratorType = $type;
}
Doctrine_Node::setRecord ( Doctrine_Record  $record)
inherited

setter for record attribute

Parameters
object$recordinstance of Doctrine_Record

Definition at line 131 of file Node.php.

{
$this->record = $record;
}
Doctrine_Node::traverse (   $type = 'Pre',
  $options = array() 
)
inherited

convenience function for getIterator

Parameters
string$typetype of iterator (Pre | Post | Level)
array$optionsoptions

Definition at line 152 of file Node.php.

{
return $this->getIterator($type, $options);
}

Field Documentation

Doctrine_Node::$iteratorOptions
protectedinherited
Parameters
array$iteratorOptions

Definition at line 53 of file Node.php.

Doctrine_Node::$iteratorType
protectedinherited
Parameters
string$iteratorType(Pre | Post | Level)

Definition at line 48 of file Node.php.

Doctrine_Node::$options
protectedinherited
Parameters
array$options

Definition at line 43 of file Node.php.

Doctrine_Node::$record
protectedinherited
Parameters
object$recordreference to associated Doctrine_Record instance

Definition at line 38 of file Node.php.


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