method getPrevUpdate documentation in bbn\Db\History
function(string $table, string $id, $from_when, $column = NULL)
{
if (Str::checkName($table) && $date = $this->validDate($from_when)) {
$tab = $this->db->escape($this->getHistoryTableName());
$line = $this->db->escape($this->getHistoryTableColumnName('uid'));
$operation = $this->db->escape($this->getHistoryTableColumnName('opr'));
$chrono = $this->db->escape($this->getHistoryTableColumnName('tst'));
if ($column) {
$where = $this->db->escape($this->getHistoryTableColumnName('col')).
' = UNHEX("'.$this->db->escapeValue(
Str::isUid($column) ? $column : $this->database_obj->columnId($column, $table)
).'")';
}
else{
$where = $this->_get_table_where($table);
}
$sql = <<< MYSQL
SELECT *
FROM $tab
WHERE $line = ?
AND ($where)
AND $operation LIKE 'UPDATE'
AND $chrono < ?
ORDER BY $chrono DESC
LIMIT 1
MYSQL;
return $this->db->getRow($sql, hex2bin($id), $date);
}
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-2023
BBN Solutions