method fullOptions documentation in bbn\Appui\Option
Returns an array of full options arrays for a given parent
Example
X::dump($opt->fullOptions(12));
/*
array [
['id' => 21, 'id_parent' => 12, 'title' => "My option 21", 'myProperty' => "78%"],
['id' => 22, 'id_parent' => 12, 'title' => "My option 22", 'myProperty' => "26%"],
['id' => 25, 'id_parent' => 12, 'title' => "My option 25", 'myProperty' => "50%"],
['id' => 27, 'id_parent' => 12, 'title' => "My option 27", 'myProperty' => "40%"]
]
function($code = NULL)
{
if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))) {
$list = $this->items($id);
if (\is_array($list)) {
$res = [];
foreach ($list as $i){
if ($tmp = $this->option($i)) {
$res[] = $tmp;
}
else {
throw new \Exception(X::_("Impossible to find the ID").' '.$i);
}
}
return $res;
}
}
return null;
}
Returns an array of full options arrays for a given parent 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