Fix editor date

Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
Riccardo Di Dato
2017-08-18 10:32:16 +02:00
parent b330d65af3
commit 13f55d62fc
2 changed files with 14 additions and 2 deletions
+12
View File
@@ -67,6 +67,18 @@ class NotiziaModel extends HasMediaModel{
self::CATEGORY_CONSIGLI_ESPERTI=>array("label"=>"I consigli degli esperti","mainMenu"=>false, "hidden"=>false,"pages"=>array("list"=>"consigliEsperti.php"),"color"=>"#3e3e3e","isSubmenu"=>null),
);
public function __construct($saveableObject){
parent::__construct($saveableObject);
if (!$this->hasProperty("about")){
$this->about = new stdClass();
}
if (!property_exists($this->about, "data") || !($this->about->date instanceof MongoDB\BSON\UTCDateTime) ){
$this->about->date = new MongoDB\BSON\UTCDateTime( time() * 1000 );
}
}
public static function getCollectionName(){
return "notizia";
}