Modificato metodo __set per model che utilizzando costanti di classe
This commit is contained in:
@@ -24,6 +24,13 @@ class MediaModel extends Model implements MediaInterface{
|
||||
$this->setMediaRenderer();
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("mediaType", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public function setMediaRenderer(){
|
||||
if($this->hasProperty("mediaType")){
|
||||
if ($this->mediaType == self::TYPE_HTML5){
|
||||
|
||||
@@ -38,8 +38,17 @@ class CommentoModel extends Model{
|
||||
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("status", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public static function getCollectionName(){
|
||||
return "commenti";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -34,6 +34,13 @@ class MailModel extends Model implements FDN_MailInterface{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("status", $attr)==0 || strcmp("priority", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public function getMailObject(){
|
||||
$email = new PHPMailer();
|
||||
|
||||
@@ -30,6 +30,13 @@ class MailTemplateModel extends Model{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("status", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public static function getCollectionName(){
|
||||
return "mailTemplate";
|
||||
|
||||
@@ -47,6 +47,13 @@ class NotiziaModel extends HasMediaModel{
|
||||
return "notizia";
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("category", $attr)==0 || strcmp("status", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -36,6 +36,13 @@ class StatisticModel extends Model {
|
||||
throw new CoreException("Invalid statistic type '".$this->statType."' while calling ".get_called_class()."::__construct()");
|
||||
}
|
||||
}
|
||||
|
||||
public function __set($attr,$value){
|
||||
if (strcmp("statType", $attr)==0){
|
||||
$value = intval($value);
|
||||
}
|
||||
return parent::__set($attr, $value);
|
||||
}
|
||||
|
||||
public static function getCollectionName(){
|
||||
return "statistics";
|
||||
|
||||
Reference in New Issue
Block a user