method optionsByCode documentation in bbn\Appui\Option
Returns an array of children options in the form code => text
Example
X::dump($opt->optionsByCode(12));
/*
array [
'opt21' => "My option 21",
'opt22' => "My option 22",
'opt25' => "My option 25",
'opt27' => "My option 27"
]
function($code = NULL)
{
if (bbn\Str::isUid($id = $this->fromCode(\func_get_args()))) {
if ($r = $this->cacheGet($id, __FUNCTION__)) {
return $r;
}
$opt = $this->db->selectAllByKeys(
$this->class_cfg['table'],
[$this->fields['code'], $this->fields['text']],
[$this->fields['id_parent'] => $id],
[$this->fields['text'] => 'ASC']
);
$this->cacheSet($id, __FUNCTION__, $opt);
return $opt;
}
return null;
}
Returns an array of children options in the form code => text 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-2025
BBN Solutions