class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Interface (View source)

Doctrine_Tree_NestedSet

Properties

protected $table from Doctrine_Tree
protected $options from Doctrine_Tree
protected $_baseComponent from Doctrine_Tree

Methods

__construct(Doctrine_Table $table, array $options)

constructor, creates tree with reference to table and sets default root options

setTableDefinition()

used to define table attributes required for the NestetSet implementation adds lft and rgt columns for corresponding left and right values

setUp()

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

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

Factory method to create a Tree.

getAttribute($name)

gets tree attribute value

setAttribute($name, $value)

sets tree attribute value

getBaseComponent()

Returns the base tree component.

createRoot(Doctrine_Record $record = null)

Creates root node from given record or from a new record.

fetchRoot(integer $rootId = 1)

Fetches a/the root node.

fetchTree($options = array(), $hydrationMode = null)

Fetches a tree.

fetchBranch($pk, $options = array(), $hydrationMode = null)

Fetches a branch of a tree.

mixed
fetchRoots()

Fetches all root nodes. If the tree has only one root this is the same as fetchRoot().

returnQueryWithRootId($query, $rootId = 1)

returns parsed query with root id where clause added if applicable

unknown
getBaseQuery()

Enter description here.

getBaseAlias()

Enter description here.

setBaseQuery(Doctrine_Query $query)

Enter description here.

resetBaseQuery()

Enter description here.

Details

__construct(Doctrine_Table $table, array $options)

constructor, creates tree with reference to table and sets default root options

Parameters

Doctrine_Table $table instance of Doctrine_Table
array $options options

setTableDefinition()

used to define table attributes required for the NestetSet implementation adds lft and rgt columns for corresponding left and right values

setUp()

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

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

Factory method to create a Tree.

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

Parameters

Doctrine_Table $table
$implName
$options

Return Value

Doctrine_Tree

Exceptions

Doctrine_Exception if class $implName does not extend Doctrine_Tree

getAttribute($name)

gets tree attribute value

Parameters

$name

setAttribute($name, $value)

sets tree attribute value

Parameters

$name
$value

getBaseComponent()

Returns the base tree component.

createRoot(Doctrine_Record $record = null)

Creates root node from given record or from a new record.

Note: When using a tree with multiple root nodes (hasManyRoots), you MUST pass in a record to use as the root. This can either be a new/transient record that already has the root id column set to some numeric value OR a persistent record. In the latter case the records id will be assigned to the root id. You must use numeric columns for the id and root id columns.

Parameters

Doctrine_Record $record instance of Doctrine_Record

Doctrine_Record fetchRoot(integer $rootId = 1)

Fetches a/the root node.

Parameters

integer $rootId

Return Value

Doctrine_Record

Iterator fetchTree($options = array(), $hydrationMode = null)

Fetches a tree.

Parameters

$options
$hydrationMode

Return Value

Iterator instance of Doctrine_Node__PreOrderIterator

iterator fetchBranch($pk, $options = array(), $hydrationMode = null)

Fetches a branch of a tree.

Parameters

$pk
$options
$hydrationMode

Return Value

iterator instance of Doctrine_Node__PreOrderIterator

mixed fetchRoots()

Fetches all root nodes. If the tree has only one root this is the same as fetchRoot().

Return Value

mixed The root nodes.

Doctrine_Query returnQueryWithRootId($query, $rootId = 1)

returns parsed query with root id where clause added if applicable

Parameters

$query
$rootId

Return Value

Doctrine_Query

unknown getBaseQuery()

Enter description here.

..

Return Value

unknown

getBaseAlias()

Enter description here.

..

setBaseQuery(Doctrine_Query $query)

Enter description here.

..

Parameters

Doctrine_Query $query

resetBaseQuery()

Enter description here.

..