Files
fdn2/private/lib/dao/models/CommentiModel.php
T
Lorenzo Giacomelli fee733f823 Aggiunta memo per la creazione di notizie media e renderer;
Aggiunto sistema di visualizzazione commenti legati alla notizia;
Creato model per commenti;
2016-01-27 17:53:35 +01:00

28 lines
594 B
PHP

<?php
class CommentiModel extends Model{
/**
* saveableObject deve avere alemeno il campo notizia = notiziaId;
* @param stdClass $saveableObject
* @throws CoreException
*/
public function __construct($saveableObject){
parent::__construct($saveableObject);
if (!$this->hasProperty("notizia") || strcmp($this->notizia,"")==0){
throw new CoreException("Impossible to build CommentiModel without field notizia");
}
if (!$this->hasProperty("date")){
$this->date = new MongoDate();
}
}
public static function getCollectionName(){
return "commenti";
}
}
?>