method getUnread documentation in bbn\Appui\Notification
function(string $id_user = NULL, array $additional_where = [])
{
$ucfg = $this->user->getClassCfg();
$where = [
'conditions' => [[
'field' => $this->db->colFullName($this->fields['read'], $this->class_table),
'operator' => 'isnull'
]]
];
if (bbn\Str::isUid($id_user)) {
$where['conditions'][] = [
'field' => $this->db->colFullName($this->fields['id_user'], $this->class_table),
'value' => $id_user
];
}
if (!empty($additional_where)) {
$where['conditions'][] = $additional_where;
}
return $this->db->rselectAll(
[
'table' => $this->class_table,
'fields' => array_merge(
array_values($this->fields), [
$this->class_cfg['arch']['content']['id_option'],
$this->class_cfg['arch']['content']['title'],
$this->class_cfg['arch']['content']['content'],
$this->class_cfg['arch']['content']['creation']
]
),
'join' => [[
'table' => $this->class_cfg['tables']['content'],
'on' => [
'conditions' => [[
'field' => $this->db->colFullName($this->fields['id_content'], $this->class_table),
'exp' => $this->db->colFullName($this->class_cfg['arch']['content']['id'], $this->class_cfg['tables']['content'])
]]
]
], [
'table' => $ucfg['table'],
'on' => [
'conditions' => [[
'field' => $this->db->colFullName($this->fields['id_user'], $this->class_table),
'exp' => $this->db->colFullName($ucfg['arch']['users']['id'], $ucfg['table'])
], [
'field' => $this->db->colFullName($ucfg['arch']['users']['active'], $ucfg['table']),
'value' => 1
]]
]
]],
'where' => $where,
'order_by' => [[
'field' => $this->db->colFullName($this->class_cfg['arch']['content']['creation'], $this->class_cfg['tables']['content']),
'dir' => 'ASC'
]]
]
);
}
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