Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ToolbarTable.php
1<?
2
4
16
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}