AbstractBase
in package
Hierarchy Tree Renderer
This is a base helper class for producing hierarchy Trees.
Tags
Table of Contents
- $dataSource : AbstractBase
- Source of hierarchy data
- $recordDriver : AbstractBase
- Hierarchical record to work on
- getHierarchyName() : string
- Get Hierarchy Name
- getTreeList() : mixed
- Get a list of trees containing the item represented by the stored record driver.
- render() : mixed
- Render the Hierarchy Tree
- setRecordDriver() : AbstractBase
- Set the record driver to operate on
- getDataSource() : AbstractBase
- Get the current hierarchy data source
- getRecordDriver() : DefaultRecord
- Get the current record driver
Properties
$dataSource
Source of hierarchy data
protected
AbstractBase
$dataSource
= null
$recordDriver
Hierarchical record to work on
protected
AbstractBase
$recordDriver
= null
Methods
getHierarchyName()
Get Hierarchy Name
public
getHierarchyName(string $hierarchyID, array<string|int, mixed> $inHierarchies, array<string|int, mixed> $inHierarchiesTitle) : string
Parameters
- $hierarchyID : string
-
The hierarchy ID to find the title for
- $inHierarchies : array<string|int, mixed>
-
An array of hierarchy IDs
- $inHierarchiesTitle : array<string|int, mixed>
-
An array of hierarchy Titles
Return values
string —A hierarchy title
getTreeList()
Get a list of trees containing the item represented by the stored record driver.
public
abstract getTreeList([string $hierarchyID = false ]) : mixed
Parameters
- $hierarchyID : string = false
-
Optional filter: specific hierarchy ID to retrieve
Return values
mixed —An array of hierarchy IDS if a hierarchy tree exists, false if it does not
render()
Render the Hierarchy Tree
public
abstract render(string $context, string $mode, string $hierarchyID[, string|null $selectedID = null ]) : mixed
Parameters
- $context : string
-
The context from which the call has been made
- $mode : string
-
The mode in which the tree should be generated
- $hierarchyID : string
-
The hierarchy ID of the tree to fetch (optional)
- $selectedID : string|null = null
-
The current record ID (optional)
Return values
mixed —The desired hierarchy tree output (or false on error)
setRecordDriver()
Set the record driver to operate on
public
setRecordDriver(AbstractBase $driver) : AbstractBase
Parameters
- $driver : AbstractBase
-
Record driver
Return values
AbstractBase —getDataSource()
Get the current hierarchy data source
protected
getDataSource() : AbstractBase
Tags
Return values
AbstractBase —getRecordDriver()
Get the current record driver
protected
getRecordDriver() : DefaultRecord