Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
resourcetable.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\DatetimeField
;
8
use
Bitrix\Main\ORM\Fields\IntegerField
;
9
use
Bitrix\Main\ORM\Fields\StringField
;
10
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
11
12
Loc::loadMessages
(__FILE__);
13
57
class
ResourceTable
extends
Main\Entity\DataManager
58
{
64
public
static
function
getTableName
()
65
{
66
return
'b_calendar_resource'
;
67
}
68
74
public
static
function
getMap
()
75
{
76
return
[
77
(
new
IntegerField
(
'ID'
))
78
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_ID_FIELD'
))
79
->configurePrimary(
true
)
80
->configureAutocomplete(
true
)
81
,
82
(
new
IntegerField
(
'EVENT_ID'
))
83
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_EVENT_ID_FIELD'
))
84
,
85
(
new
StringField
(
'CAL_TYPE'
,
86
[
87
'validation'
=> [__CLASS__,
'validateCalType'
]
88
]
89
))
90
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_CAL_TYPE_FIELD'
))
91
,
92
(
new
IntegerField
(
'RESOURCE_ID'
))
93
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_RESOURCE_ID_FIELD'
))
94
->configureRequired(
true
)
95
,
96
(
new
StringField
(
'PARENT_TYPE'
,
97
[
98
'validation'
=> [__CLASS__,
'validateParentType'
]
99
]
100
))
101
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_PARENT_TYPE_FIELD'
))
102
,
103
(
new
IntegerField
(
'PARENT_ID'
))
104
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_PARENT_ID_FIELD'
))
105
->configureRequired(
true
)
106
,
107
(
new
IntegerField
(
'UF_ID'
))
108
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_UF_ID_FIELD'
))
109
,
110
(
new
DatetimeField
(
'DATE_FROM_UTC'
))
111
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DATE_FROM_UTC_FIELD'
))
112
,
113
(
new
DatetimeField
(
'DATE_TO_UTC'
))
114
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DATE_TO_UTC_FIELD'
))
115
,
116
(
new
DatetimeField
(
'DATE_FROM'
))
117
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DATE_FROM_FIELD'
))
118
,
119
(
new
DatetimeField
(
'DATE_TO'
))
120
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DATE_TO_FIELD'
))
121
,
122
(
new
IntegerField
(
'DURATION'
))
123
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DURATION_FIELD'
))
124
,
125
(
new
StringField
(
'SKIP_TIME'
,
126
[
127
'validation'
=> [__CLASS__,
'validateSkipTime'
]
128
]
129
))
130
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_SKIP_TIME_FIELD'
))
131
,
132
(
new
StringField
(
'TZ_FROM'
,
133
[
134
'validation'
=> [__CLASS__,
'validateTzFrom'
]
135
]
136
))
137
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_TZ_FROM_FIELD'
))
138
,
139
(
new
StringField
(
'TZ_TO'
,
140
[
141
'validation'
=> [__CLASS__,
'validateTzTo'
]
142
]
143
))
144
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_TZ_TO_FIELD'
))
145
,
146
(
new
IntegerField
(
'TZ_OFFSET_FROM'
))
147
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_TZ_OFFSET_FROM_FIELD'
))
148
,
149
(
new
IntegerField
(
'TZ_OFFSET_TO'
))
150
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_TZ_OFFSET_TO_FIELD'
))
151
,
152
(
new
IntegerField
(
'CREATED_BY'
))
153
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_CREATED_BY_FIELD'
))
154
->configureRequired(
true
)
155
,
156
(
new
DatetimeField
(
'DATE_CREATE'
))
157
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_DATE_CREATE_FIELD'
))
158
,
159
(
new
DatetimeField
(
'TIMESTAMP_X'
))
160
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_TIMESTAMP_X_FIELD'
))
161
,
162
(
new
StringField
(
'SERVICE_NAME'
,
163
[
164
'validation'
=> [__CLASS__,
'validateServiceName'
]
165
]
166
))
167
->configureTitle(
Loc::getMessage
(
'RESOURCE_ENTITY_SERVICE_NAME_FIELD'
))
168
,
169
];
170
}
171
177
public
static
function
validateCalType
(): array
178
{
179
return
[
180
new
LengthValidator
(
null
, 100),
181
];
182
}
183
189
public
static
function
validateParentType
(): array
190
{
191
return
[
192
new
LengthValidator
(
null
, 100),
193
];
194
}
195
201
public
static
function
validateSkipTime
(): array
202
{
203
return
[
204
new
LengthValidator
(
null
, 1),
205
];
206
}
207
213
public
static
function
validateTzFrom
(): array
214
{
215
return
[
216
new
LengthValidator
(
null
, 50),
217
];
218
}
219
225
public
static
function
validateTzTo
(): array
226
{
227
return
[
228
new
LengthValidator
(
null
, 50),
229
];
230
}
231
237
public
static
function
validateServiceName
(): array
238
{
239
return
[
240
new
LengthValidator
(
null
, 200),
241
];
242
}
243
}
Bitrix\Calendar\Internals\ResourceTable\validateServiceName
static validateServiceName()
Definition
resourcetable.php:237
Bitrix\Calendar\Internals\ResourceTable\getMap
static getMap()
Definition
resourcetable.php:74
Bitrix\Calendar\Internals\ResourceTable\validateCalType
static validateCalType()
Definition
resourcetable.php:177
Bitrix\Calendar\Internals\ResourceTable\validateSkipTime
static validateSkipTime()
Definition
resourcetable.php:201
Bitrix\Calendar\Internals\ResourceTable\validateTzFrom
static validateTzFrom()
Definition
resourcetable.php:213
Bitrix\Calendar\Internals\ResourceTable\validateTzTo
static validateTzTo()
Definition
resourcetable.php:225
Bitrix\Calendar\Internals\ResourceTable\validateParentType
static validateParentType()
Definition
resourcetable.php:189
Bitrix\Calendar\Internals\ResourceTable\getTableName
static getTableName()
Definition
resourcetable.php:64
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.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
resourcetable.php
Создано системой
1.10.0