Files
fdn2/app/private/lib/dao/models/LogModel.php
T
2022-08-29 23:20:16 +02:00

37 lines
644 B
PHP

<?php
/*
Author: Riccardo Di Dato
Creation Date: 27/gen/2016
*/
class LogModel extends Model {
public function __construct($saveableObject = null){
parent::__construct($saveableObject);
if (!$this->hasProperty("date")){
// $this->date = new MongoDate();
$this->date = new MongoDB\BSON\UTCDateTime( time() * 1000 );
}
}
public function getCode(){
return $this->id;
}
public static function getCollectionName(){
return "guiLog";
}
public static function fromException(Exception $ex){
$tmp = new stdClass();
$tmp->message = $ex->getMessage();
$tmp->trace = strval($ex);
return new self($tmp);
}
}
?>