method getContacts documentation in bbn\User\Email
function()
{
$contacts = $this->class_cfg['tables']['users_contacts'];
$cfg_c = $this->class_cfg['arch']['users_contacts'];
$links = $this->class_cfg['tables']['users_contacts_links'];
$cfg_l = $this->class_cfg['arch']['users_contacts_links'];
$rows = $this->db->rselectAll(
[
'tables' => [$links],
'fields' => [
$this->db->cfn($cfg_l['id'], $links),
$this->db->cfn($cfg_l['value'], $links),
$this->db->cfn($cfg_l['id_contact'], $links),
$this->db->cfn($cfg_l['num_sent'], $links),
$this->db->cfn($cfg_l['last_sent'], $links),
$this->db->cfn($cfg_c['name'], $contacts),
$this->db->cfn($cfg_c['cfg'], $contacts),
$this->db->cfn($cfg_c['blacklist'], $contacts),
'sortIndex' => 'IFNULL(' . $this->db->cfn($cfg_c['name'], $contacts, true) . ',' . $this->db->cfn($cfg_l['value'], $links) . ')'
],
'join' => [
[
'table' => $contacts,
'on' => [
[
'field' => $cfg_l['id_contact'],
'exp' => $this->db->cfn($cfg_c['id'], $contacts)
]
]
]
],
'where' => [
'id_user' => $this->user->getId(),
'type' => 'email'
],
'order' => [
'sortIndex' => 'ASC'
]
]
);
$res = [];
if ($rows) {
foreach ($rows as $r) {
$res[] = [
'value' => $r['id'],
'text' => (empty($r['name']) ? '' : $r['name'] . ' - ') . $r['value'],
'cfg' => empty($r['cfg']) ? [] : json_decode($r['cfg'], true),
'id_contact' => $r['id_contact'],
'num_sent' => $r['num_sent'],
'last_sent' => $r['last_sent'],
'blacklist' => $r['blacklist']
];
}
}
return $res;
}
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