PHP Class TreeBehavior

Long description for file
Inheritance: extends ModelBehavior
ファイルを表示 Open project: openeyes/openeyes Class Usage Examples

Public Properties

Property Type Description
$idAttribute
$leftAttribute
$rightAttribute

Protected Properties

Property Type Description
$_cacheStub

Public Methods

Method Description
ancestorIds ( ) returns all parent object ids (note there may be more than one because any object can exist in more than one tree).
ancestorIdsMatch ( $ids, $ancestor_ids ) * utlity function that will check whether any of the list $ids appear in the trees of any of the $ancestor_ids (including the ancestor ids themselves)
ancestorOfIds ( $ids ) returns true if the owner is an ancestor of any of the ids passed in.
childIds ( ) immediate child ids of the object (note that these children might not be all in one tree, given that a node can exist in more than one tree).
children ( )
descendentIds ( ) returns all descendant ids of the object, across any trees the the object exists in.
parentIds ( ) get immediate parent ids for the object (note there may be more than one because any disorder can exist in more than one tree).
rootIds ( ) returns the object ids that are at the top of trees.
treeStart ( ) works out the starting point for a new tree.
treeTable ( ) : string

Protected Methods

Method Description
_ancestorIds ( CDbConnection $db, string $table, string $obj_id ) Returns all the ancestor ids of the provided object id.
_descendentIds ( $db, $tree_table, $obj_id ) * gets the list of left and right boundaries for any given owner objects
_treeLimits ( CDbConnection $db, string $tree_table, string $obj_id ) gets the list of left and right boundaries for any given owner objects.
getCacheStub ( )
treeLimits ( $owner ) * gets the list of left and right boundaries for any given owner objects

Method Details

_ancestorIds() protected method

Returns all the ancestor ids of the provided object id.
protected _ancestorIds ( CDbConnection $db, string $table, string $obj_id )
$db CDbConnection
$table string
$obj_id string

_descendentIds() protected method

* gets the list of left and right boundaries for any given owner objects
protected _descendentIds ( $db, $tree_table, $obj_id )
$db
$tree_table
$obj_id

_treeLimits() protected method

gets the list of left and right boundaries for any given owner objects.
protected _treeLimits ( CDbConnection $db, string $tree_table, string $obj_id )
$db CDbConnection
$tree_table string
$obj_id string

ancestorIds() public method

returns all parent object ids (note there may be more than one because any object can exist in more than one tree).
public ancestorIds ( )

ancestorIdsMatch() public method

* utlity function that will check whether any of the list $ids appear in the trees of any of the $ancestor_ids (including the ancestor ids themselves)
public ancestorIdsMatch ( $ids, $ancestor_ids )

ancestorOfIds() public method

returns true if the owner is an ancestor of any of the ids passed in.
public ancestorOfIds ( $ids )

childIds() public method

immediate child ids of the object (note that these children might not be all in one tree, given that a node can exist in more than one tree).
public childIds ( )

children() public method

public children ( )

descendentIds() public method

returns all descendant ids of the object, across any trees the the object exists in.
public descendentIds ( )

getCacheStub() protected method

protected getCacheStub ( )

parentIds() public method

get immediate parent ids for the object (note there may be more than one because any disorder can exist in more than one tree).
public parentIds ( )

rootIds() public method

returns the object ids that are at the top of trees.
public rootIds ( )

treeLimits() protected method

* gets the list of left and right boundaries for any given owner objects
protected treeLimits ( $owner )
$owner

treeStart() public method

works out the starting point for a new tree.
public treeStart ( )

treeTable() public method

public treeTable ( ) : string
return string the associated database table name

Property Details

$_cacheStub protected_oe property

protected $_cacheStub

$idAttribute public_oe property

public $idAttribute

$leftAttribute public_oe property

public $leftAttribute

$rightAttribute public_oe property

public $rightAttribute