method optionsByAlias documentation in bbn\Appui\Option
Returns an array of options based on their id_alias
Example
X::dump($opt->optionsByAlias(36));
/*
array [
['id' => 18, 'text' => "My option 1", 'code' => "opt1", 'myProperty' => "50%"],
['id' => 21, 'text' => "My option 4", 'code' => "opt4", 'myProperty' => "60%"],
['id' => 23, 'text' => "My option 6", 'code' => "opt6", 'myProperty' => "90%"]
]
function($code = NULL)
{
$id_alias = $this->fromCode(\func_get_args());
if (bbn\Str::isUid($id_alias)) {
$where = [$this->fields['id_alias'] => $id_alias];
$list = $this->getRows($where);
if (\is_array($list)) {
$res = [];
foreach ($list as $i){
$res[] = $this->option($i);
}
return $res;
}
}
return null;
}
Returns an array of options based on their id_alias 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