Dotclear 2.24
Loading...
Searching...
No Matches
nestedTree Class Reference
Inheritance diagram for nestedTree:
dcCategories

Public Member Functions

 __construct ($con)
 
 getChildren (int $start=0, ?int $id=null, string $sort='asc', array $fields=[])
 
 getParents (int $id, array $fields=[])
 
 getParent (int $id, array $fields=[])
 
 addNode ($data, int $target=0)
 
 updatePosition (int $id, int $left, int $right)
 
 deleteNode (int $node, bool $keep_children=true)
 
 resetOrder ()
 
 setNodeParent (int $node, int $target=0)
 
 setNodePosition (int $nodeA, int $nodeB, string $position='after')
 

Protected Member Functions

 getCondition (string $start='AND', string $prefix='')
 

Protected Attributes

 $con
 
 $table
 
 $f_left
 
 $f_right
 
 $f_id
 
 $add_condition = []
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $con)

Constructs a new instance.

Parameters
mixed$conThe con

References $con.

Member Function Documentation

◆ getChildren()

getChildren ( int  $start = 0,
?int  $id = null,
string  $sort = 'asc',
array  $fields = [] 
)

Gets the children.

Parameters
int$startThe start
int$idThe identifier
string$sortThe sort
array$fieldsThe fields
Returns
dcRecord The children.

References getCondition().

◆ getParents()

getParents ( int  $id,
array  $fields = [] 
)

Gets the parents.

Parameters
int$idThe identifier
array$fieldsThe fields
Returns
dcRecord The parents.

Reimplemented in dcCategories.

◆ getParent()

getParent ( int  $id,
array  $fields = [] 
)

Gets the parent.

Parameters
int$idThe identifier
array$fieldsThe fields
Returns
dcRecord The parents.

Reimplemented in dcCategories.

◆ addNode()

addNode (   $data,
int  $target = 0 
)

Adds a node.

Parameters
mixed$dataThe data
int$targetThe target
Exceptions
Exception
Returns
mixed

◆ updatePosition()

updatePosition ( int  $id,
int  $left,
int  $right 
)

Update position

Parameters
int$idThe identifier
int$leftThe left
int$rightThe right

◆ deleteNode()

deleteNode ( int  $node,
bool  $keep_children = true 
)

Delete a node

Parameters
int$nodeThe node
bool$keep_childrenkeep children
Exceptions
Exception

◆ resetOrder()

resetOrder ( )

Reset order

◆ setNodeParent()

setNodeParent ( int  $node,
int  $target = 0 
)

Sets the node parent.

Parameters
int$nodeThe node
int$targetThe target
Exceptions
Exception

◆ setNodePosition()

setNodePosition ( int  $nodeA,
int  $nodeB,
string  $position = 'after' 
)

Sets the node position.

Parameters
int$nodeAThe node a
int$nodeBThe node b
string$positionThe position
Exceptions
Exception

◆ getCondition()

getCondition ( string  $start = 'AND',
string  $prefix = '' 
)
protected

Gets the condition.

Parameters
string$startThe start
string$prefixThe prefix
Returns
string The condition.

Referenced by getChildren().

Field Documentation

◆ $con

$con
protected

Referenced by __construct().

◆ $table

$table
protected

◆ $f_left

$f_left
protected

◆ $f_right

$f_right
protected

◆ $f_id

$f_id
protected

◆ $add_condition

$add_condition = []
protected

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