52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
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 POSITION_TOP = 4;
|
|
const POSITION_BOTTOM = 5;
|
|
|
|
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"),
|
|
self::POSITION_TOP=>array("label"=>"Inizio pagina"),
|
|
self::POSITION_BOTTOM=>array("label"=>"Fine pagina")
|
|
);
|
|
|
|
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";
|
|
}
|
|
|
|
}
|
|
|
|
?>
|