Class: Doctrine_Tree_NestedSet

Source Location: /Doctrine/Tree/NestedSet.php

Class Doctrine_Tree_NestedSet

Class Overview

Implements interfaces:

Doctrine_Tree_NestedSet

Located in /Doctrine/Tree/NestedSet.php [line 32]

Doctrine_Tree
   |
   --Doctrine_Tree_NestedSet
Author(s): Information Tags:
Version:  $Revision: 2230 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Doctrine_Tree

Doctrine_Tree::$options
Doctrine_Tree::$table
Doctrine_Tree::$_baseComponent

Inherited From Doctrine_Tree

Doctrine_Tree::__construct()
constructor, creates tree with reference to table and any options
Doctrine_Tree::factory()
factory method to return tree instance based upon chosen implementation
Doctrine_Tree::getAttribute()
gets tree attribute value
Doctrine_Tree::getBaseComponent()
Returns the base tree component.
Doctrine_Tree::setAttribute()
sets tree attribute value
Doctrine_Tree::setTableDefinition()
Used to define table attributes required for the given implementation
Doctrine_Tree::setUp()
this method is used for setting up relations and attributes and should be used by specific implementations

[ Top ]
Property Summary
mixed   $_baseAlias  
mixed   $_baseQuery  

[ Top ]
Method Summary
Doctrine_Tree_NestedSet   __construct()   constructor, creates tree with reference to table and sets default root options
void   createRoot()   creates root node from given record or from a new record
mixed   fetchBranch()   Fetches a branch of a tree.
void   fetchRoot()   Fetches a/the root node.
mixed   fetchRoots()   Fetches all root nodes. If the tree has only one root this is the same as fetchRoot().
mixed   fetchTree()   Fetches a tree.
object   findRoot()   returns root node
void   getBaseAlias()   Enter description here...
unknown   getBaseQuery()   Enter description here...
integer   getMaxRootId()   calculates the current max root id
integer   getNextRootId()   calculates the next available root id
void   resetBaseQuery()   Enter description here...
object Doctrine_Query   returnQueryWithRootId()   returns parsed query with root id where clause added if applicable
void   setBaseQuery()   Enter description here...
void   setTableDefinition()   used to define table attributes required for the NestetSet implementation
void   _createBaseQuery()   Enter description here...

[ Top ]
Properties
mixed   $_baseAlias = "base" [line 35]
API Tags:
Access:  private


[ Top ]
mixed   $_baseQuery [line 34]
API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 43]

  Doctrine_Tree_NestedSet __construct( Doctrine_Table $table, array $options  )

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

Parameters:
object   $table:  instance of Doctrine_Table
array   $options:  options

API Tags:
Access:  public


Redefinition of:
Doctrine_Tree::__construct()
constructor, creates tree with reference to table and any options

[ Top ]
createRoot  [line 74]

  void createRoot( [Doctrine_Record $record = null]  )

creates root node from given record or from a new record

Parameters:
object   $record:  instance of Doctrine_Record

API Tags:
Access:  public


Implementation of:
Doctrine_Tree_Interface::createRoot()
creates root node from given record or from a new record

[ Top ]
fetchBranch  [line 176]

  mixed fetchBranch( mixed $pk, [array $options = array()]  )

Fetches a branch of a tree.

Parameters:
mixed   $pk:  primary key as used by table::find() to locate node to traverse tree from
array   $options:  Options.

API Tags:
Return:  The branch or FALSE if the branch could not be found.
Access:  public

Information Tags:
Todo:  Only fetch the lft and rgt values of the initial record. more is not needed.

Implementation of:
Doctrine_Tree_Interface::fetchBranch()
optimised method that returns iterator for traversal of the tree from the given record primary key

[ Top ]
fetchRoot  [line 110]

  void fetchRoot( [integer $rootId = 1]  )

Fetches a/the root node.

Parameters:
integer   $rootId: 

API Tags:
Access:  public


[ Top ]
fetchRoots  [line 199]

  mixed fetchRoots( )

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


API Tags:
Return:  The root nodes.
Access:  public


[ Top ]
fetchTree  [line 142]

  mixed fetchTree( [array $options = array()]  )

Fetches a tree.

Parameters:
array   $options:  Options

API Tags:
Return:  The tree or FALSE if the tree could not be found.
Access:  public


Implementation of:
Doctrine_Tree_Interface::fetchTree()
optimised method to returns iterator for traversal of the entire tree from root

[ Top ]
findRoot  [line 100]

  object findRoot( [ $rootId = 1]  )

returns root node

Parameters:
   $rootId: 

API Tags:
Return:  instance of Doctrine_Record
Deprecated:  Use fetchRoot()
Access:  public


Implementation of:
Doctrine_Tree_Interface::findRoot()
returns root node

[ Top ]
getBaseAlias  [line 279]

  void getBaseAlias( )

Enter description here...


API Tags:
Access:  public


[ Top ]
getBaseQuery  [line 267]

  unknown getBaseQuery( array $options  )

Enter description here...

Parameters:
array   $options: 

API Tags:
Access:  public


[ Top ]
getMaxRootId  [line 221]

  integer getMaxRootId( )

calculates the current max root id


API Tags:
Access:  public


[ Top ]
getNextRootId  [line 211]

  integer getNextRootId( )

calculates the next available root id


API Tags:
Access:  public


[ Top ]
resetBaseQuery  [line 315]

  void resetBaseQuery( )

Enter description here...


API Tags:
Access:  public


[ Top ]
returnQueryWithRootId  [line 247]

  object Doctrine_Query returnQueryWithRootId( object $query, [ $rootId = 1], integer $root_id  )

returns parsed query with root id where clause added if applicable

Parameters:
object   $query:  Doctrine_Query
integer   $root_id:  id of destination root
   $rootId: 

API Tags:
Access:  public


[ Top ]
setBaseQuery  [line 301]

  void setBaseQuery( Doctrine_Query $query  )

Enter description here...

Parameters:
Doctrine_Query   $query: 

API Tags:
Access:  public


[ Top ]
setTableDefinition  [line 58]

  void setTableDefinition( )

used to define table attributes required for the NestetSet implementation

adds lft and rgt columns for corresponding left and right values


API Tags:
Access:  public


Redefinition of:
Doctrine_Tree::setTableDefinition()
Used to define table attributes required for the given implementation

[ Top ]
_createBaseQuery  [line 288]

  void _createBaseQuery( )

Enter description here...


API Tags:
Access:  private


[ Top ]