Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/skyweb24.popuppro/lib/entity/ |
Upload File : |
<?php namespace Skyweb24\Popuppro\Entity; use Bitrix\Main\Localization\Loc, Bitrix\Main\ORM\Data\DataManager, Bitrix\Main\ORM\Fields\IntegerField, Bitrix\Main\ORM\Fields\StringField, Bitrix\Main\ORM\Fields\TextField, Bitrix\Main\ORM\Fields\Validators\LengthValidator; Loc::loadMessages(__FILE__); /** * Class PopupproTable * * Fields: * <ul> * <li> id int mandatory * <li> sort int mandatory * <li> active string(1) optional * <li> name string(50) optional * <li> type string(30) mandatory * <li> stat_show int optional * <li> stat_time int optional * <li> stat_action int optional * <li> settings text mandatory * <li> cont_iblock int optional * <li> cont_posttemplate int optional * </ul> * * @package Bitrix\Popuppro **/ class PopupproTable extends DataManager { /** * Returns DB table name for entity. * * @return string */ public static function getTableName() { return 'skyweb24_popuppro'; } /** * Returns entity map definition. * * @return array */ public static function getMap() { return [ new IntegerField( 'id', [ 'primary' => true, 'autocomplete' => true, 'title' => Loc::getMessage('POPUPPRO_ENTITY_ID_FIELD') ] ), new IntegerField( 'sort', [ 'required' => true, 'title' => Loc::getMessage('POPUPPRO_ENTITY_SORT_FIELD') ] ), new StringField( 'active', [ 'validation' => [__CLASS__, 'validateActive'], 'title' => Loc::getMessage('POPUPPRO_ENTITY_ACTIVE_FIELD') ] ), new StringField( 'name', [ 'validation' => [__CLASS__, 'validateName'], 'title' => Loc::getMessage('POPUPPRO_ENTITY_NAME_FIELD') ] ), new StringField( 'type', [ 'required' => true, 'validation' => [__CLASS__, 'validateType'], 'title' => Loc::getMessage('POPUPPRO_ENTITY_TYPE_FIELD') ] ), new IntegerField( 'stat_show', [ 'title' => Loc::getMessage('POPUPPRO_ENTITY_STAT_SHOW_FIELD') ] ), new IntegerField( 'stat_time', [ 'title' => Loc::getMessage('POPUPPRO_ENTITY_STAT_TIME_FIELD') ] ), new IntegerField( 'stat_action', [ 'title' => Loc::getMessage('POPUPPRO_ENTITY_STAT_ACTION_FIELD') ] ), new TextField( 'settings', [ 'required' => true, 'title' => Loc::getMessage('POPUPPRO_ENTITY_SETTINGS_FIELD'), 'save_data_modification' => function () { return array( function ($value) { return serialize($value); } ); }, 'fetch_data_modification' => function () { return array( function ($value) { return unserialize($value); } ); } ] ), new IntegerField( 'cont_iblock', [ 'title' => Loc::getMessage('POPUPPRO_ENTITY_CONT_IBLOCK_FIELD') ] ), new IntegerField( 'cont_posttemplate', [ 'title' => Loc::getMessage('POPUPPRO_ENTITY_CONT_POSTTEMPLATE_FIELD') ] ), ]; } /** * Returns validators for active field. * * @return array */ public static function validateActive() { return [ new LengthValidator(null, 1), ]; } /** * Returns validators for name field. * * @return array */ public static function validateName() { return [ new LengthValidator(null, 50), ]; } /** * Returns validators for type field. * * @return array */ public static function validateType() { return [ new LengthValidator(null, 30), ]; } }