method nativeTree documentation in bbn\Appui\Option
Returns a hierarchical structure as stored in its original form in the database
Example
X::dump($opt->nativeTree(12));
/*
array [
'id' => 12,
'code' => "bbn_ide",
'text' => "BBN's own IDE",
'id_alias' => null,
'value' => "{\"myProperty\":\"My property's value\"}",
'items' => [
[
'id' => 25,
'code' => "test",
'text' => "Test",
'id_alias' => null,
'value' => "{\"myProperty\":\"My property's value\"}",
],
[
'id' => 26,
'code' => "test2",
'text' => "Test 2",
'id_alias' => null,
'value' => "{\"myProperty\":\"My property's value\"}",
'items' => [
[
'id' => 42,
'code' => "test8",
'text' => "Test 8",
'id_alias' => null,
'value' => "{\"myProperty\":\"My property's value\"}",
]
]
],
]
]
function($code = NULL)
{
if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))) {
if ($res = $this->nativeOption($id)) {
$its = $this->items($id);
if (!empty($its)) {
$res['items'] = [];
foreach ($its as $it){
$res['items'][] = $this->nativeTree($it);
}
}
return $res;
}
}
return null;
}
Returns a hierarchical structure as stored in its original form in the database 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