Files
register/marko_unpacked/marko/cms/models/History.php
T
Admin Nasledstvo ac168868ee Initial import
2026-05-01 20:52:04 +03:00

32 lines
726 B
PHP

<?php
namespace app\models;
/**
* Class History
* @package app\models
* @property int $action
* @property string $user
* @property string $table_name
* @property int $history_id
* @property string $date_time
* @property string $date
*/
class History extends _Base
{
public static function addNew($id, $table, $user, $edit = false)
{
$history = new History();
$history->history_id = $id;
$history->action = $edit == true ? 2 : 1;
$history->table_name = $table;
$history->user = $user;
$history->date_time = date('Y-m-d H:i:s');
$history->save();
}
public function getDate() {
return date('d.m.Y', strtotime($this->date_time));
}
}