method getAllHistory documentation in bbn\Db\History
function(string $table, int $start = 0, int $limit = 20, string $dir = NULL)
{
if ($id_table = $this->database_obj->tableId($table, $this->db->getCurrent())) {
$tab = $this->db->escape($this->getHistoryTableName());
$tab_uids = $this->db->escape($this->getHistoryUidsTableName());
$uid = $this->db->cfn($this->getHistoryUidsColumnName('bbn_uid'), $this->getHistoryUidsTableName(), true);
$id_tab = $this->db->cfn($this->getHistoryUidsColumnName('bbn_table'), $this->getHistoryUidsTableName(), true);
$uid2 = $this->db->cfn($this->getHistoryTableColumnName('uid'), $this->getHistoryTableName(), true);
$chrono = $this->db->cfn($this->getHistoryTableColumnName('tst'), $this->getHistoryTableName(), true);
$order = $dir && (Str::changeCase($dir, 'lower') === 'asc') ? 'ASC' : 'DESC';
$sql = <<< MYSQL
SELECT DISTINCT($uid)
FROM $tab_uids
JOIN $tab
ON $uid = $uid2
WHERE $id_tab = ?
ORDER BY $chrono $order
LIMIT $start, $limit
MYSQL;
return $this->db->getColArray($sql, hex2bin($id_table));
}
return [];
}
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