Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ToolbarTable.php
1
<?
2
3
namespace
Bitrix\Main\SidePanel
;
4
5
use
Bitrix\Main\ORM\Data
;
6
use
Bitrix\Main\ORM\Fields\StringField
;
7
use
Bitrix\Main\ORM\Fields\BooleanField
;
8
use
Bitrix\Main\ORM\Fields\IntegerField
;
9
use
Bitrix\Main\ORM\Fields\DatetimeField
;
10
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
11
use
Bitrix\Main\ORM\Fields\Validators\ForeignValidator
;
12
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
13
use
Bitrix\Main\ORM\Query\Join
;
14
use
Bitrix\Main\Type\DateTime
;
15
use
Bitrix\Main\UserTable
;
16
33
class
ToolbarTable
extends
Data\DataManager
34
{
38
public
static
function
getTableName
()
39
{
40
return
'b_sidepanel_toolbar'
;
41
}
42
46
public
static
function
getMap
()
47
{
48
return
[
49
(
new
IntegerField
(
'ID'
))
50
->configurePrimary()
51
->configureAutocomplete()
52
,
53
(
new
IntegerField
(
'USER_ID'
))
54
->configureRequired()
55
->addValidator(
new
ForeignValidator
(
UserTable::getEntity
()->getField(
'ID'
)))
56
,
57
(
new
StringField
(
'CONTEXT'
))
58
->configureRequired()
59
->configureSize(50)
60
->configureFormat(
'/^[a-zA-Z0-9_:-]+$/'
)
61
->addValidator(
new
LengthValidator
(2, 50))
62
->addSaveDataModifier(
function
($value) {
63
return
mb_strtolower($value);
64
})
65
,
66
(
new
BooleanField
(
'COLLAPSED'
))
67
->configureValues(0, 1)
68
->configureDefaultValue(1)
69
,
70
(
new
DatetimeField
(
'CREATED_DATE'
))
71
->configureDefaultValue(
static
function
() {
72
return
new
DateTime
();
73
})
74
,
75
(
new
Reference
(
76
'USER'
,
77
UserTable::class,
78
Join::on(
'this.USER_ID'
,
'ref.ID'
),
79
[
'join_type'
=> Join::TYPE_INNER]
80
)),
81
];
82
}
83
}
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
Bitrix\Main\ORM\Data\DataManager\getEntity
static getEntity()
Definition
datamanager.php:78
Bitrix\Main\ORM\Fields\BooleanField
Definition
booleanfield.php:20
Bitrix\Main\ORM\Fields\DatetimeField
Definition
datetimefield.php:22
Bitrix\Main\ORM\Fields\IntegerField
Definition
integerfield.php:20
Bitrix\Main\ORM\Fields\Relations\Reference
Definition
reference.php:26
Bitrix\Main\ORM\Fields\StringField
Definition
stringfield.php:20
Bitrix\Main\ORM\Fields\Validators\ForeignValidator
Definition
foreignvalidator.php:24
Bitrix\Main\ORM\Fields\Validators\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Main\SidePanel\ToolbarTable
Definition
ToolbarTable.php:34
Bitrix\Main\SidePanel\ToolbarTable\getMap
static getMap()
Definition
ToolbarTable.php:46
Bitrix\Main\SidePanel\ToolbarTable\getTableName
static getTableName()
Definition
ToolbarTable.php:38
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\UserTable
Definition
user.php:46
Bitrix\Main\ORM\Data
Definition
addresult.php:9
Bitrix\Main\SidePanel
Definition
Toolbar.php:2
modules
main
lib
SidePanel
ToolbarTable.php
Создано системой
1.10.0