A tree structures with {@link XoopsObject}s as nodes
Methods | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
public
|
__construct(array &$objectArr, string $myId, string $parentId, string $rootId = null)
Constructor
Constructor Parameters
|
# | ||||||||||||||||
protected
|
initialize()
Initialize the object
Initialize the object |
# | ||||||||||||||||
public
&
|
getTree(): array
Get the tree
Get the tree ReturnsAssociative array comprising the tree |
# | ||||||||||||||||
public
&
|
getByKey(string $key): object
returns an object from the tree specified by its id
returns an object from the tree specified by its id Parameters
ReturnsObject within the tree |
# | ||||||||||||||||
public
|
getFirstChild(string $key): array
returns an array of all the first child object of an object specified by its id
returns an array of all the first child object of an object specified by its id Parameters
ReturnsArray of children of the parent |
# | ||||||||||||||||
public
|
getAllChild(string $key, array $ret = []): array
returns an array of all child objects of an object specified by its id
returns an array of all child objects of an object specified by its id Parameters
ReturnsArray of child nodes. |
# | ||||||||||||||||
public
|
getAllParent(string $key, array $ret = [], int $upLevel = 1): array
returns an array of all parent objects.
the key of returned array represents how many levels up from the specified…
returns an array of all parent objects. the key of returned array represents how many levels up from the specified object Parameters
ReturnsArray of parent nodes. |
# | ||||||||||||||||
protected
|
makeSelBoxOptions(
string $fieldName,
string $selected,
int $key,
string &$ret,
string $prefix_orig,
string $prefix_curr = '',
): void
Make options for a select box from
Make options for a select box from Deprecatedsince 2.5.9, please use makeSelectElement() functionality Parameters
|
# | ||||||||||||||||
public
|
makeSelBox(
string $name,
string $fieldName,
string $prefix = '-',
string $selected = '',
bool $addEmptyOption = false,
integer $key = 0,
string $extra = '',
): string
Make a select box with options from the tree
Make a select box with options from the tree Deprecatedsince 2.5.9, please use makeSelectElement() Parameters
ReturnsHTML select box |
# | ||||||||||||||||
public
|
makeSelectElement(
string $name,
string $fieldName,
string $prefix = '-',
string $selected = '',
bool $addEmptyOption = false,
integer $key = 0,
string $extra = '',
string $caption = '',
): XoopsFormSelect
Make a select box with options from the tree
Make a select box with options from the tree Parameters
Returnsform element |
# | ||||||||||||||||
protected
|
addSelectOptions(
XoopsFormSelect $element,
string $fieldName,
int $key,
string $prefix_orig,
string $prefix_curr = '',
): void
Make options for a select box from
Make options for a select box from Parameters
|
# | ||||||||||||||||
public
|
__get(string $name): mixed
Magic __get method
Magic __get method Some modules did not respect the leading underscore is private convention and broke when code was modernized. This will keep them running for now. Parameters
Returnsvalue |
# |
Properties | |||
---|---|---|---|
protected
|
|
$parentId
|
# |
protected
|
|
$myId
|
# |
protected
|
|
$rootId
|
# |
protected
|
|
$tree = []
|
# |
protected
|
|
$objects
|
# |