Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ItemTable.php
1<?php
3
12use Bitrix\UI\Avatar;
13
15{
16 public static function getTableName(): string
17 {
18 return 'b_ui_avatar_mask_item';
19 }
20
21 public static function getMap(): array
22 {
23 return array(
24 (new IntegerField('ID'))
25 ->configurePrimary()
26 ->configureAutocomplete(),
27 (new IntegerField('FILE_ID'))->configureRequired(),
28
29 (new StringField('OWNER_TYPE'))->configureRequired()->configureSize(100),
30 (new StringField('OWNER_ID', []))->configureRequired()->configureSize(20),
31
32 new StringField('GROUP_ID'),
33
34 new StringField('TITLE'),
35 new TextField('DESCRIPTION'),
36 (new IntegerField('SORT'))->configureDefaultValue(100),
37
38 (new DatetimeField('TIMESTAMP_X'))
39 ->configureRequired()
40 ->configureDefaultValue(function() {
41 return new DateTime();
42 }),
43
44 (new Reference(
45 'FILE',
46 FileTable::class,
47 Join::on('this.FILE_ID', 'ref.ID')
48 ))->configureJoinType(Join::TYPE_INNER),
49
50 (new Reference(
51 'SHARED_FOR',
52 Avatar\Model\AccessTable::class,
53 Join::on('this.ID', 'ref.ITEM_ID')
54 ))->configureJoinType(Join::TYPE_INNER),
55
56 (new Reference(
57 'RECENTLY_USED_BY',
58 Avatar\Model\RecentlyUsedTable::class,
59 Join::on('this.ID', 'ref.ITEM_ID')
60 ))->configureJoinType(Join::TYPE_INNER)
61 );
62 }
63}