Aggiunto sistema di visualizzazione commenti legati alla notizia; Creato model per commenti;
28 lines
594 B
PHP
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";
|
|
}
|
|
}
|
|
?>
|