method countByType documentation in bbn\Appui\Note
function($type = NULL, $id_user = false)
{
$db = &$this->db;
$cf = &$this->class_cfg;
if (!Str::isUid($type)) {
$type = self::getOptionId(is_null($type) ? 'personal' : $type, 'types');
}
if (Str::isUid($type)) {
$where = [[
'field' => $cf['arch']['notes']['active'],
'value' => 1,
], [
'field' => $cf['arch']['notes']['id_type'],
'value' => $type,
]];
if (!empty($id_user) && Str::isUid($id_user)) {
$where[] = [
'field' => $cf['arch']['notes']['creator'],
'value' => $id_user,
];
}
return $db->selectOne(
[
'table' => $cf['table'],
'fields' => ['COUNT(DISTINCT ' . $cf['arch']['notes']['id'] . ')'],
'where' => [
'conditions' => $where,
],
]
);
}
return false;
}
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