84 lines
2.6 KiB
PHP
84 lines
2.6 KiB
PHP
<?
|
|
namespace common\template\notify;
|
|
|
|
use core\db\structure\Column as C;
|
|
use core\db\structure\eColumnType;
|
|
use ui\form\structure\eInputType;
|
|
use ui\Form;
|
|
use ui\input\Input;
|
|
use core\lang\structure\LangVariable as V;
|
|
use ms\ms\structure\msModuleTable;
|
|
use common\template\notify\history\structure\templateNotifyHistoryLang as Vars;
|
|
|
|
|
|
|
|
class History extends msModuleTable {
|
|
static $self;
|
|
static $table_name = 'templateNotifyHistory';
|
|
static $controller = 'template.notify.history';
|
|
|
|
static $ID = 'id';
|
|
static $TEMPLATE = 'template';
|
|
static $PROFILE = 'profile';
|
|
static $DATA = 'data';
|
|
static $VIEWED = 'viewed';
|
|
static $CREATED = 'created';
|
|
|
|
|
|
static function getTitle(){return V::get(Vars::$MODULE_NAME);}
|
|
static function getSystemLangValues():array{ return Vars::getArray(); }
|
|
|
|
public static function installUniques() {
|
|
\DB::addIndex(self::$table_name,self::$TEMPLATE);
|
|
\DB::addIndex(self::$table_name,self::$PROFILE);
|
|
\DB::addIndex(self::$table_name,self::$VIEWED);
|
|
\DB::addIndex(self::$table_name,self::$CREATED);
|
|
}
|
|
|
|
|
|
static function columnInfo() : array {
|
|
return [
|
|
new C([
|
|
C::VAR_NAME =>&self::$ID,
|
|
C::TYPE =>eColumnType::INT,
|
|
C::AUTO_INCREMENT =>true,
|
|
C::PRIMARY =>true,
|
|
C::DEFAULT =>0,
|
|
C::HIDDEN =>true,
|
|
C::TH =>V::get(Vars::$ID),
|
|
]),
|
|
new C([
|
|
C::VAR_NAME => &self::$TEMPLATE,
|
|
C::TYPE => eColumnType::INT,
|
|
]),
|
|
new C([
|
|
C::VAR_NAME => &self::$PROFILE,
|
|
C::TYPE => eColumnType::INT,
|
|
]),
|
|
new C([
|
|
C::VAR_NAME => &self::$DATA,
|
|
C::TYPE => eColumnType::TEXT,
|
|
]),
|
|
new C([
|
|
C::VAR_NAME => &self::$VIEWED,
|
|
C::TYPE => eColumnType::TINYINT,
|
|
C::DEFAULT => 0,
|
|
]),
|
|
new C([
|
|
C::VAR_NAME => &self::$CREATED,
|
|
C::TYPE => eColumnType::INT,
|
|
C::LENGTH => 11,
|
|
C::TH => V::get(Vars::$CREATED),
|
|
C::DEFAULT => time(),
|
|
c::FUNC_VALUE => function($v){return self::formatDate($v[self::$CREATED]);},
|
|
c::HIDDEN=>true,
|
|
]),
|
|
];
|
|
}
|
|
|
|
}
|
|
new History();
|
|
|
|
|
|
///
|