method getMaxBitNum documentation in bbn\User\Preferences
Gets the maximum num value of the user option's bits.
function(string $id_user_option, string $id_parent = NULL, bool $incr = false)
{
if (
\bbn\Str::isUid($id_user_option)
&& (\bbn\Str::isUid($id_parent) || is_null($id_parent))
&& ($cf = $this->getClassCfg())
&& ($cfg = $cf['arch']['user_options_bits'])
) {
if (
$max = $this->db->selectOne(
[
'table' => $cf['tables']['user_options_bits'],
'fields' => ["MAX($cfg[num])"],
'where' => [
'conditions' => [[
'field' => $cfg['id_user_option'],
'value' => $id_user_option
], [
'field' => $cfg['id_parent'],
empty($id_parent) ? 'operator' : 'value' => $id_parent ?: 'isnull'
]]
]
]
)
) {
$max = (int)$max;
return $incr ? $max + 1 : $max;
}
return 0;
}
return 0;
}
Gets the maximum num value of the user option's bits. 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