method getBits documentation in bbn\User\Preferences
Returns the bits list of a preference
function(string $id_user_option, $id_parent = false, bool $with_config = true)
{
if ($this->isAuthorized($id_user_option)) {
$c = $this->class_cfg['arch']['user_options_bits'];
$t = $this;
$where = [[
'field' => $c['id_user_option'],
'value' => $id_user_option
]];
if (\is_null($id_parent) || \bbn\Str::isUid($id_parent)) {
$where[] = [
'field' => $c['id_parent'],
empty($id_parent) ? 'operator' : 'value' => $id_parent ?: 'isnull'
];
}
if (
\bbn\Str::isUid($id_user_option)
&& ($bits = $this->db->rselectAll(
[
'table' => $this->class_cfg['tables']['user_options_bits'],
'fields' => [],
'where' => [
'conditions' => $where
],
'order' => [[
'field' => $c['num'],
'dir' => 'ASC'
]]
]
))
) {
if (!empty($with_config)) {
return array_map(
function ($b) use ($t) {
return $t->explodeBitCfg($b);
},
$bits
);
}
return $bits;
}
}
return [];
}
Returns the bits list of a preference 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