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

47 lines
1014 B
PHP

<?php
class BannerModel extends HasMediaModel{
// const TYPE_IMAGE = 1;
// const TYPE_HTML = 2;
// public static $BANNER_TYPES = array(
// self::TYPE_IMAGE=>array("label"=>"Image"),
// self::TYPE_HTML=>array("label"=>"Html")
// );
const POSITION_HEAD = 1;
const POSITION_BODY = 2;
const POSITION_LONG = 3;
const GENERAL_CATEGORY = 0;
public static $BANNER_POSITIONS = array(
self::POSITION_HEAD=>array("label"=>"Testata"),
self::POSITION_BODY=>array("label"=>"Corpo"),
self::POSITION_LONG=>array("label"=>"Corpo Lungo")
);
public function __construct($saveableObject = null){
parent::__construct($saveableObject);
if (!$this->hasProperty("categories")){
$this->categories = array(self::GENERAL_CATEGORY);
}
}
public function __set($attr,$value){
if (strcmp("type", $attr)==0 || strcmp("position", $attr)==0){
$value = intval($value);
}
return parent::__set($attr, $value);
}
public static function getCollectionName(){
return "banner";
}
}
?>