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/ORM/ |
Upload File : |
<?php namespace Skyweb24\Popuppro\ORM; 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 AddColorsTable * * Fields: * <ul> * <li> id int mandatory * <li> template string(50) mandatory * <li> name string(50) optional * <li> variable text mandatory * </ul> * * @package Bitrix\Popuppro **/ class AddColorsTable extends DataManager { /** * Returns DB table name for entity. * * @return string */ public static function getTableName() { return 'skyweb24_popuppro_add_colors'; } /** * Returns entity map definition. * * @return array */ public static function getMap() { return [ new IntegerField( 'id', [ 'primary' => true, 'autocomplete' => true, 'title' => Loc::getMessage('ADD_COLORS_ENTITY_ID_FIELD') ] ), new StringField( 'template', [ 'required' => true, 'validation' => [__CLASS__, 'validateTemplate'], 'title' => Loc::getMessage('ADD_COLORS_ENTITY_TEMPLATE_FIELD') ] ), new StringField( 'name', [ 'validation' => [__CLASS__, 'validateName'], 'title' => Loc::getMessage('ADD_COLORS_ENTITY_NAME_FIELD') ] ), new TextField( 'variable', [ 'required' => true, 'title' => Loc::getMessage('ADD_COLORS_ENTITY_VARIABLE_FIELD') ] ), ]; } /** * Returns validators for template field. * * @return array */ public static function validateTemplate() { return [ new LengthValidator(null, 50), ]; } /** * Returns validators for name field. * * @return array */ public static function validateName() { return [ new LengthValidator(null, 50), ]; } }