method getFolders documentation in bbn\User\Email
function($account, $force = false)
{
$acc = is_array($account) ? $account : $acc = $this->getAccount($account);
if ($acc) {
$types = self::getFolderTypes();
if ($force) {
$this->syncFolders($acc['id']);
}
$cfg = $this->class_cfg['arch']['users_emails'];
$table = $this->class_cfg['tables']['users_emails'];
return X::map(
function ($a) use ($types, $cfg, $table) {
if (!isset($a['uid'])) {
//die(X::dump("NO UID", $a, debug_backtrace()));
}
$res = [
'id' => $a['id'],
'id_account' => $a['id_user_option'],
'text' => $a['text'],
'uid' => $a['uid'],
'id_option' => $a['id_option'],
'id_parent' => $a['id_parent'] ?? null,
'type' => X::getField($types, ['id' => $a['id_option']], 'code'),
'db_uid_max' => $this->db->selectOne(
$table,
'MAX(' . $this->db->csn($cfg['msg_uid'], true) . ')',
[
$cfg['id_folder'] => $a['id'],
$cfg['id_user'] => $this->user->getId()
]
),
'db_uid_min' => $this->db->selectOne(
$table,
'MIN(' . $this->db->csn($cfg['msg_uid'], true) . ')',
[
$cfg['id_folder'] => $a['id'],
$cfg['id_user'] => $this->user->getId()
]
),
'num_msg' => $this->db->count($table, [$cfg['id_folder'] => $a['id']]),
'last_uid' => $a['last_uid'] ?? null,
'last_check' => $a['last_check'] ?? null,
'hash' => $a['hash'] ?? null,
'subscribed' => $a['subscribed'] ?? false
];
if (!empty($a['items'])) {
$res['items'] = $a['items'];
}
return $res;
},
$this->pref->getFullBits($acc['id']),
'items'
);
}
return null;
}
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