method fullTree documentation in bbn\Appui\Option
Returns a full hierarchical structure of options from a given option
Example
X::dump($opt->fullTree(12));
/*
array [
'id' => 12,
'code' => "bbn_ide",
'text' => "BBN's own IDE",
'id_alias' => null,
'myProperty' => "My property's value",
'items' => [
[
'id' => 25,
'code' => "test",
'text' => "Test",
'id_alias' => null,
'myProperty' => "My property's value",
],
[
'id' => 26,
'code' => "test2",
'text' => "Test 2",
'id_alias' => null,
'myProperty' => "My property's value",
'items' => [
[
'id' => 42,
'code' => "test8",
'text' => "Test 8",
'id_alias' => null,
'myProperty' => "My property's value",
]
]
],
]
]
function($code = NULL)
{
if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))
&& ($res = $this->option($id))
) {
if ($opts = $this->items($id)) {
$res['items'] = [];
foreach ($opts as $o){
if ($t = $this->fullTree($o)) {
$res['items'][] = $t;
}
}
}
return $res;
}
return null;
}
Returns a full hierarchical structure of options from a given option BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions