public function __construct($dbo, $data = false) { $this->dbo = $dbo; parent::__construct($data); $this->range = new \Models\Range($this->range); // Force to UTC + set defaults $this->range->from = isset($this->range->from) ? \Bolt\Epoch::convert($this->range->from, "Y-m-d\\TH:i:sP", "UTC") : "2014-08-10T00:00:00+00:00"; $this->range->to = \Bolt\Epoch::convert(isset($this->range->to) ? $this->range->to : \Bolt\Epoch::time(), "Y-m-d\\TH:i:sP", "UTC"); }
public function audit($event, $type, $action, $id, $timestamp = null) { if ($timestamp === null) { $timestamp = \Bolt\Epoch::convert(\Bolt\Epoch::time(), "Y-m-d\\TH:i:sP", "UTC"); } $audit = new Log\Audit(); $audit->type($type); $audit->action($action); $audit->id($id); $this->timestamp($timestamp); $this->category("audit"); $this->event($event); $this->data($audit); $this->convert(); }