\RedBeanPHP\UtilTree

Tree

Given a bean, finds it children or parents in a hierarchical structure.

Summary

Methods
Properties
Constants
__construct()
children()
parents()
countChildren()
countParents()
No public properties found
No constants found
No protected methods found
$toolbox
$writer
$oodb
N/A
No private methods found
No private properties found
N/A

Properties

Methods

__construct()

__construct(\RedBeanPHP\ToolBox  $toolbox) 

Constructor, creates a new instance of the Tree.

Parameters

\RedBeanPHP\ToolBox $toolbox

toolbox

children()

children(\RedBeanPHP\OODBBean  $bean, string|NULL  $sql = NULL, array  $bindings = array()) : array

Returns all child beans associates with the specified bean in a tree structure.

Parameters

\RedBeanPHP\OODBBean $bean

reference bean to find children of

string|NULL $sql

optional SQL snippet

array $bindings

optional parameter bindings for SQL snippet

Returns

array

parents()

parents(\RedBeanPHP\OODBBean  $bean, string|NULL  $sql = NULL, array  $bindings = array()) : array

Returns all parent beans associates with the specified bean in a tree structure.

Parameters

\RedBeanPHP\OODBBean $bean

reference bean to find parents of

string|NULL $sql

optional SQL snippet

array $bindings

optional parameter bindings for SQL snippet

Returns

array

countChildren()

countChildren(\RedBeanPHP\OODBBean  $bean, string|NULL  $sql = NULL, array  $bindings = array(), string|boolean  $select = TRUE) : integer

Counts all children beans associates with the specified bean in a tree structure.

Parameters

\RedBeanPHP\OODBBean $bean

reference bean to find children of

string|NULL $sql

optional SQL snippet

array $bindings

optional parameter bindings for SQL snippet

string|boolean $select

select snippet to use (advanced, optional, see QueryWriter::queryRecursiveCommonTableExpression)

Returns

integer

countParents()

countParents(\RedBeanPHP\OODBBean  $bean, string|NULL  $sql = NULL, array  $bindings = array(), string|boolean  $select = TRUE) : integer

Counts all parent beans associates with the specified bean in a tree structure.

Parameters

\RedBeanPHP\OODBBean $bean

reference bean to find parents of

string|NULL $sql

optional SQL snippet

array $bindings

optional parameter bindings for SQL snippet

string|boolean $select

select snippet to use (advanced, optional, see QueryWriter::queryRecursiveCommonTableExpression)

Returns

integer