Doctrine 1.2.4
Doctrine_Tree_AdjacencyList Class Reference

Inherits Doctrine_Tree, and Doctrine_Tree_Interface.

Public Member Functions

 createRoot (Doctrine_Record $record=null)
 
 fetchBranch ($pk, $options=array(), $hydrationMode=null)
 
 fetchRoot ($root_id=1)
 
 fetchTree ($options=array(), $hydrationMode=null)
 
 getAttribute ($name)
 
 getBaseComponent ()
 
 setAttribute ($name, $value)
 
 setTableDefinition ()
 
 setUp ()
 

Static Public Member Functions

static factory (Doctrine_Table $table, $implName, $options=array())
 

Protected Attributes

 $options = array()
 
 $table
 

Detailed Description

Definition at line 33 of file AdjacencyList.php.

Member Function Documentation

Doctrine_Tree_Interface::createRoot ( Doctrine_Record  $record = null)
inherited

creates root node from given record or from a new record

Parameters
Doctrine_Record$recordinstance of Doctrine_Record
static Doctrine_Tree::factory ( Doctrine_Table  $table,
  $implName,
  $options = array() 
)
staticinherited

Factory method to create a Tree.

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

Parameters
object$tableinstance of Doctrine_Table
string$impNameimplementation (NestedSet, AdjacencyList, MaterializedPath)
array$optionsoptions
Returns
Doctrine_Tree
Exceptions
Doctrine_Exceptionif class $implName does not extend Doctrine_Tree

Definition at line 99 of file Tree.php.

{
$class = 'Doctrine_Tree_' . $implName;
if ( ! class_exists($class)) {
throw new Doctrine_Exception('The chosen class must extend Doctrine_Tree');
}
return new $class($table, $options);
}
Doctrine_Tree_Interface::fetchBranch (   $pk,
  $options = array(),
  $hydrationMode = null 
)
inherited

optimised method that returns iterator for traversal of the tree from the given record primary key

Parameters
mixed$pkprimary key as used by table::find() to locate node to traverse tree from
array$optionsoptions
integer$fetchmodeOne of the Doctrine_Core::HYDRATE_* constants.
Returns
iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator
Doctrine_Tree_Interface::fetchRoot (   $root_id = 1)
inherited

returns root node

Returns
Doctrine_Record
Doctrine_Tree_Interface::fetchTree (   $options = array(),
  $hydrationMode = null 
)
inherited

optimised method to returns iterator for traversal of the entire tree from root

Parameters
array$optionsoptions
integer$fetchmodeOne of the Doctrine_Core::HYDRATE_* constants.
Returns
Iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator
Doctrine_Tree::getAttribute (   $name)
inherited

gets tree attribute value

Definition at line 112 of file Tree.php.

{
return isset($this->options[$name]) ? $this->options[$name] : null;
}
Doctrine_Tree::getBaseComponent ( )
inherited

Returns the base tree component.

Definition at line 130 of file Tree.php.

{
return $this->_baseComponent;
}
Doctrine_Tree::setAttribute (   $name,
  $value 
)
inherited

sets tree attribute value

Parameters
mixed

Definition at line 122 of file Tree.php.

{
$this->options[$name] = $value;
}
Doctrine_Tree::setTableDefinition ( )
inherited

Used to define table attributes required for the given implementation

Exceptions
Doctrine_Tree_Exceptionif table attributes have not been defined

Definition at line 74 of file Tree.php.

{
throw new Doctrine_Tree_Exception('Table attributes have not been defined for this Tree implementation.');
}
Doctrine_Tree::setUp ( )
inherited

this method is used for setting up relations and attributes and should be used by specific implementations

Definition at line 83 of file Tree.php.

{
}

Field Documentation

Doctrine_Tree::$options = array()
protectedinherited
Parameters
array$options

Definition at line 43 of file Tree.php.

Doctrine_Tree::$table
protectedinherited
Parameters
object$tablereference to associated Doctrine_Table instance

Definition at line 38 of file Tree.php.


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