64 lines
1.4 KiB
PHP
64 lines
1.4 KiB
PHP
|
|
<?
|
||
|
|
namespace widget\video;
|
||
|
|
|
||
|
|
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 widget\video\profile\structure\widgetVideoProfileLang as Vars;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
class Profile extends msModuleTable {
|
||
|
|
static $self;
|
||
|
|
static $table_name = 'widgetVideoProfile';
|
||
|
|
static $controller = 'widget.video.profile';
|
||
|
|
|
||
|
|
static $ID = 'id';
|
||
|
|
|
||
|
|
static $data;
|
||
|
|
|
||
|
|
static function getTitle(){return V::get(Vars::$MODULE_NAME);}
|
||
|
|
static function getSystemLangValues():array{ return Vars::getArray(); }
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
static function init(){
|
||
|
|
self::$data = self::getOneEqualByColumn(self::$ID,PID);
|
||
|
|
if(!self::$data){
|
||
|
|
self::insert([
|
||
|
|
self::$ID => PID,
|
||
|
|
]);
|
||
|
|
self::$data = self::getOneEqualByColumn(self::$ID,PID);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function installUniques() {
|
||
|
|
\DB::addIndex(self::$table_name,self::$ID);
|
||
|
|
}
|
||
|
|
|
||
|
|
static function columnInfo() : array {
|
||
|
|
return [
|
||
|
|
new C([
|
||
|
|
C::VAR_NAME =>&self::$ID,
|
||
|
|
C::TYPE =>eColumnType::INT,
|
||
|
|
C::PRIMARY =>true,
|
||
|
|
C::DEFAULT =>0,
|
||
|
|
C::HIDDEN =>true,
|
||
|
|
]),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
new Profile();
|
||
|
|
|
||
|
|
|
||
|
|
///
|
||
|
|
|
||
|
|
|
||
|
|
|