Methods
_flattenArray()
_flattenArray($sourcearray, $destarray, $lastid, $level)
Inherited
inherited_from |
\cTreeItem::_flattenArray() |
Parameters
$sourcearray
$destarray
$lastid
$level
adds an item as a subitem to the current item
addItem(\cTreeItem $item) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::addItem() |
Parameters
adds an item to a specific ID
addItemToID(string $id, \cTreeItem $item) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::addItemToID() |
Parameters
$id
string
id ID to add the item to
cTreeItem()
cTreeItem($id, $name, $collapsed)
Inherited
inherited_from |
\cTreeItem::cTreeItem() |
Parameters
$id
$name
$collapsed
collapseBelowID()
collapseBelowID(int $id, $found) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::collapseBelowID() |
Parameters
$id
int
leveloffset Level offset. Ignores all expand operations below the offset.
$found
collapseBelowLevel()
collapseBelowLevel(int $leveloffset) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::collapseBelowLevel() |
Parameters
$leveloffset
int
leveloffset Level offset. Ignores all expand operations below the offset.
deletes an attribute
deleteAttribute(string $attributeName) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::deleteAttribute() |
Parameters
$attributeName
string
attributeName
deletes a subitem
deleteItem(mixed $id) : \deleted
Inherited
access |
public |
inherited_from |
\cTreeItem::deleteItem() |
Parameters
$id
mixed
item object or ID to delete
Returns
\deleted
object
expandBelowID()
expandBelowID(int $id, $found) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::expandBelowID() |
Parameters
$id
int
leveloffset Level offset. Ignores all expand operations below the offset.
$found
expandBelowLevel()
expandBelowLevel(int $leveloffset) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::expandBelowLevel() |
Parameters
$leveloffset
int
leveloffset Level offset. Ignores all expand operations below the offset.
Exports a tree as an array of arrays. Array format:
array(
array("id" => "Item ID", "name" => "Item name", "level" => 1, "attributes" => array("attr_name" => "attr_value"))
);
exportTree() : array
Inherited
access |
public |
inherited_from |
\cTreeItem::exportTree() |
Returns
array
flatTraverse
traverses the tree starting from this item, and returning
all objects as $objects in a flat array.
flatTraverse(integer $level)
Inherited
inherited_from |
\cTreeItem::flatTraverse() |
Parameters
$level
integer
Level to start on
returns an attribute
getAttribute(string $attributeName) : mixed
Inherited
access |
public |
inherited_from |
\cTreeItem::getAttribute() |
Parameters
$attributeName
string
attributeName
Returns
mixed
getCollapsedList
Returns all items (as ID array) which are collapsed.
getCollapsedList(array $list)
Inherited
inherited_from |
\cTreeItem::getCollapsedList() |
Parameters
$list
array
Contains the list with all collapsed items
getExpandedList
Returns all items (as ID array) which are expanded.
getExpandedList(array $list)
Inherited
inherited_from |
\cTreeItem::getExpandedList() |
Parameters
$list
array
Contains the list with all expanded items
Retrieves a specific item by its ID. Note that this
function traverses all subitems to find the correct item.
getItemByID(string $id) : \cTreeItem
Inherited
access |
public |
inherited_from |
\cTreeItem::getItemByID() |
Parameters
$id
string
id ID to retrieve
Returns
hasAttribute()
hasAttribute($attributeName, $bRecursive)
Inherited
inherited_from |
\cTreeItem::hasAttribute() |
Parameters
$attributeName
$bRecursive
importStructuredArray()
importStructuredArray($array)
Inherited
inherited_from |
\cTreeItem::importStructuredArray() |
Parameters
$array
Imports a table from an array of arrays. Array format:
array(
array("id" => "Item ID", "name" => "Item name", "level" => 1, "collapsed" => true|false, "attributes" => array("attr_name" => "attr_value"))
);
importTable(array $flat_array) : void
Inherited
The entries "collapsed" and "attributes" are optional!
access |
public |
inherited_from |
\cTreeItem::importTable() |
Parameters
$flat_array
array
flat_array See above
moves an item to another object
moveItem(\cTreeItem $targetItem, mixed $itemToMove) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::moveItem() |
Parameters
$targetItem
\cTreeItem
targetItem Item to move the subitem to
$itemToMove
mixed
itemToMove cTreeItem-Object or id of object to move
sets a custom attribute for this TreeItem
setAttribute(string $attributeName, array $attributeValue) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setAttribute() |
Parameters
$attributeName
string
attributeName
$attributeValue
array
attributeValue The value(s) of the attribute
sets a bunch of attributes
setAttributes(string $aAttributeArray) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setAttributes() |
Parameters
$aAttributeArray
string
attributeName
setCollapsed()
setCollapsed(mixed $id) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setCollapsed() |
Parameters
$id
mixed
collapse ID to collapse or an array with items to collapse
setExpanded()
setExpanded(mixed $id) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setExpanded() |
Parameters
$id
mixed
expand ID of item to expand or array of item ID's to expand
setName
sets the Name for this item.
setName(string $name) : \none
Inherited
inherited_from |
\cTreeItem::setName() |
Parameters
$name
string
New name for this item
Returns
\none
sets a payload object for later reference
setPayloadObject(object $payload) : void
Inherited
access |
public |
inherited_from |
\cTreeItem::setPayloadObject() |
Parameters
$payload
object
payload The object to payload
sets a new name for the tree.
setTreeName(string $name) : void
Parameters
$name
string
name Name of the tree
traverse
traverses the tree starting from this item, and returning
all objects as $objects in a nested array.
traverse(object $objects, integer $level)
Inherited
inherited_from |
\cTreeItem::traverse() |
Parameters
$objects
object
all found objects
$level
integer
Level to start on
unsets a payload object
unsetPayloadObject() : object
Inherited
access |
public |
inherited_from |
\cTreeItem::unsetPayloadObject() |
Returns
object
Properties
Contains custom entries
$_attributes : array
Inherited
inherited_from |
\cTreeItem::$$_attributes |
Determinates if this tree item is collapsed
$_collapsed : boolean
Inherited
inherited_from |
\cTreeItem::$$_collapsed |
ID for this item
$_id : string
Inherited
inherited_from |
\cTreeItem::$$_id |
Contains the level of this item
$_level : integer
Inherited
inherited_from |
\cTreeItem::$$_level |
Name for this item
$_name : string
Inherited
inherited_from |
\cTreeItem::$$_name |
Contains the next item
$_next : array
Inherited
inherited_from |
\cTreeItem::$$_next |
Contains the parent of this item
$_parent : array
Inherited
inherited_from |
\cTreeItem::$$_parent |
Contains the previous item
$_previous : array
Inherited
inherited_from |
\cTreeItem::$$_previous |
Sub Items for this tree item
$_subitems : array
Inherited
inherited_from |
\cTreeItem::$$_subitems |