$ERRORS
$ERRORS : array
Ошибки
Класс для работы с деревьями в виде Nested Sets
$dataPoint : \Colibri\Data\DataAccessPoint
Точка доступа
__construct(\Colibri\Data\DataAccessPoint $dtp, string $table, string $id, string $left, string $right, string $level, string $parent)
Конструктор
| \Colibri\Data\DataAccessPoint | $dtp | |
| string | $table | |
| string | $id | |
| string | $left | |
| string | $right | |
| string | $level | |
| string | $parent |
GetParentInfo(integer $section_id, array $condition = '') : \Colibri\Data\Models\DataRow
Receives parent left, right and level for unit with number $id.
| integer | $section_id | |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
Insert(integer $section_id, array $data = array()) : integer
Add a new element in the tree to element with number $section_id.
| integer | $section_id | Number of a parental element |
| array | $data | Contains parameters for additional fields of a tree (if is): array('filed name' => 'importance', etc) |
Inserted element id
InsertNear(integer $id, array $condition = '', array $data = array()) : integer
Add a new element in the tree near element with number id.
| integer | $id | Number of a parental element |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
| array | $data | Contains parameters for additional fields of a tree (if is): array('filed name' => 'importance', etc) |
Inserted element id
ChangePositionAll(integer $id1, integer $id2, string $position = 'after', array $condition = '') : boolean
Swapping nodes within the same level and limits of one parent with all its children: $id1 placed before or after $id2.
| integer | $id1 | first item ID |
| integer | $id2 | second item ID |
| string | $position | 'before' or 'after' $id2 |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
TRUE if successful, FALSE otherwise.
Delete(integer $id, array $condition = '') : boolean
Delete element with number $id from the tree wihtout deleting it's children.
| integer | $id | Number of element |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
TRUE if successful, FALSE otherwise.
DeleteAll(integer $id, array $condition = '') : boolean
Delete element with number $id from the tree and all it childret.
| integer | $id | Number of element |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
TRUE if successful, FALSE otherwise.
CountAll(integer $id, array $condition = '') : boolean
Counts element with number $id from the tree and all it childret.
| integer | $id | Number of element |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
TRUE if successful, FALSE otherwise.
Full(array $fields, array $condition = '', string $joinWith = '', integer $page = -1, integer $pagesize = 10) : array
Returns all elements of the tree sortet by left.
| array | $fields | needed fields (if is): array('filed1 name', 'filed2 name', etc) |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
| string | $joinWith | Join string |
| integer | $page | Page |
| integer | $pagesize | Pagesize |
needed fields
Branch(integer $id, array $fields = '', array $condition = '', array $joinWith = '', integer $page = -1, integer $pagesize = 10) : \Colibri\Data\SqlClient\IDataReader
Returns all elements of a branch starting from an element with number $id.
| integer | $id | Node unique id |
| array | $fields | needed fields (if is): array('filed1 name', 'filed2 name', etc) |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
| array | $joinWith | Array structure: array('outer' => array('table' => 'condition'), 'inner' => array('table', 'condition')), etc where array key - join type (inner, outer, cross), condition - condition string |
| integer | $page | Page |
| integer | $pagesize | Pagesize |
Parents(integer $id, array $fields = '', array $condition = '', string $joinWith = '') : \Colibri\Data\SqlClient\IDataReader
Returns all parents of element with number $id.
| integer | $id | Node unique id |
| array | $fields | needed fields (if is): array('filed1 name', 'filed2 name', etc) |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
| string | $joinWith | Join string |
Ajar(integer $id, array $fields = '', array $condition = '', integer $page = -1, integer $pagesize = 10) : \Colibri\Data\SqlClient\IDataReader
Returns a slightly opened tree from an element with number $id.
| integer | $id | Node unique id |
| array | $fields | needed fields (if is): array('filed1 name', 'filed2 name', etc) |
| array | $condition | Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string |
| integer | $page | Page |
| integer | $pagesize | Pagesize |
_PrepareCondition(array $condition, boolean $where = false, string $prefix = '') : string
Transform array with conditions to SQL query Array structure: array('and' => array('id = 0', 'id2 >= 3'), 'or' => array('sec = \'www\'', 'sec2 <> \'erere\'')), etc where array key - condition (AND, OR, etc), value - condition string.
| array | $condition | |
| boolean | $where |
|
| string | $prefix |
_PrepareJoin(string $joinWith, string $prefix = '') : string
Transform array with conditions to SQL query Array structure: array $joinWith Array structure: array('outer' => array('table' => array('fieldfrom', 'fieldto')), 'inner' => array('table' => array('fieldfrom', 'fieldto')), etc where array key - join type (inner, outer, cross), condition - condition string where array key - condition (AND, OR, etc), value - condition string.
| string | $joinWith | |
| string | $prefix |