method getBitsByIdOption documentation in bbn\User\Preferences
Returns the bits list of an option's id
function(string $id_opt, $id_parent = false, bool $with_config = true)
{
$c = $this->class_cfg['arch']['user_options_bits'];
$where = [[
'field' => $c['id_user_option'],
'value' => $id_opt
]];
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_opt)
&& ($bits = $this->db->rselectAll(
[
'table' => $this->class_cfg['tables']['user_options_bits'],
'fields' => [],
'where' => $where,
'order' => [[
'field' => $c['num'],
'dir' => 'ASC'
]]
]
))
) {
$res = [];
foreach ($bits as $bit) {
if ($this->isAuthorized($bit['id_user_option'])) {
$res[] = $with_config ? $this->explodeBitCfg($bit) : $bit;
}
}
return $res;
}
return null;
}
Returns the bits list of an option's id 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