51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
class Publication extends ObjectModel
|
|
{
|
|
public $id;
|
|
|
|
public $id_publication;
|
|
|
|
public $id_block_ads;
|
|
public $id_shop;
|
|
public $date_from;
|
|
public $date_to;
|
|
public $date_add;
|
|
public $date_upd;
|
|
|
|
public static $definition = array(
|
|
'table' => 'ads_publication',
|
|
'primary' => 'id_publication',
|
|
'multilang' => true,
|
|
'fields' => array(
|
|
'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
|
'content' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isAnything'),
|
|
'date_from' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
'date_to' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
),
|
|
);
|
|
|
|
public static function getAllPages()
|
|
{
|
|
return array(
|
|
'index',
|
|
'postcms', //Article
|
|
'categorycms', //Category d'article
|
|
'postedito', //Article mise en forme différent
|
|
);
|
|
}
|
|
|
|
public static function getPageNameTranslated($page_name)
|
|
{
|
|
$array = array(
|
|
'index' => 'Page d\'accueil',
|
|
'postcms' => 'Article', //Article
|
|
'categorycms' => 'Catégorie d\'article', //Category d'article
|
|
'postedito' => 'Edito', //Article mise en forme différent
|
|
);
|
|
|
|
return isset($array[$page_name]) ? $array[$page_name] : $page_name;
|
|
}
|
|
} |