Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
typetable.php
1
<?php
2
3
namespace
Bitrix\Calendar\Internals
;
4
5
use
Bitrix\Main
;
6
use
Bitrix\Main\Localization\Loc
;
7
use
Bitrix\Main\ORM\Fields\BooleanField
;
8
use
Bitrix\Main\ORM\Fields\StringField
;
9
use
Bitrix\Main\ORM\Fields\TextField
;
10
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
11
39
class
TypeTable
extends
Main\Entity\DataManager
40
{
46
public
static
function
getTableName
()
47
{
48
return
'b_calendar_type'
;
49
}
50
56
public
static
function
getMap
()
57
{
58
return
[
59
(
new
StringField
(
'XML_ID'
,
60
[
61
'validation'
=> [__CLASS__,
'validateXmlId'
]
62
]
63
))
64
->configureTitle(
Loc::getMessage
(
'TYPE_ENTITY_XML_ID_FIELD'
))
65
->configurePrimary(
true
)
66
,
67
(
new
StringField
(
'NAME'
,
68
[
69
'validation'
=> [__CLASS__,
'validateName'
]
70
]
71
))
72
->configureTitle(
Loc::getMessage
(
'TYPE_ENTITY_NAME_FIELD'
))
73
,
74
(
new
TextField
(
'DESCRIPTION'
))
75
->configureTitle(
Loc::getMessage
(
'TYPE_ENTITY_DESCRIPTION_FIELD'
))
76
,
77
(
new
StringField
(
'EXTERNAL_ID'
,
78
[
79
'validation'
=> [__CLASS__,
'validateExternalId'
]
80
]
81
))
82
->configureTitle(
Loc::getMessage
(
'TYPE_ENTITY_EXTERNAL_ID_FIELD'
))
83
,
84
(
new
BooleanField
(
'ACTIVE'
))
85
->configureTitle(
Loc::getMessage
(
'TYPE_ENTITY_ACTIVE_FIELD'
))
86
->configureValues(
'N'
,
'Y'
)
87
->configureDefaultValue(
'Y'
)
88
,
89
];
90
}
91
97
public
static
function
validateXmlId
(): array
98
{
99
return
[
100
new
LengthValidator
(
null
, 255),
101
];
102
}
103
109
public
static
function
validateName
(): array
110
{
111
return
[
112
new
LengthValidator
(
null
, 255),
113
];
114
}
115
121
public
static
function
validateExternalId
(): array
122
{
123
return
[
124
new
LengthValidator
(
null
, 100),
125
];
126
}
127
}
Bitrix\Calendar\Internals\TypeTable\getMap
static getMap()
Definition
typetable.php:56
Bitrix\Calendar\Internals\TypeTable\validateExternalId
static validateExternalId()
Definition
typetable.php:121
Bitrix\Calendar\Internals\TypeTable\validateXmlId
static validateXmlId()
Definition
typetable.php:97
Bitrix\Calendar\Internals\TypeTable\validateName
static validateName()
Definition
typetable.php:109
Bitrix\Calendar\Internals\TypeTable\getTableName
static getTableName()
Definition
typetable.php:46
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Fields\BooleanField
Definition
booleanfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\TextField
Definition
textfield.php:20
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Calendar\Internals
Definition
access.php:3
Bitrix\Main
modules
calendar
lib
internals
typetable.php
Создано системой
1.10.0