Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
linkfile.php
1
<?php
2
namespace
Bitrix\Im\Model
;
3
4
use Bitrix\Disk\Internals\FileTable;
5
use
Bitrix\Main\ORM\Data\DataManager
;
6
use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
7
use
Bitrix\Main\ORM\Fields\DatetimeField
;
8
use
Bitrix\Main\ORM\Fields\IntegerField
;
9
use
Bitrix\Main\ORM\Fields\Relations\Reference
;
10
use
Bitrix\Main\ORM\Fields\StringField
;
11
use
Bitrix\Main\ORM\Fields\Validators\LengthValidator
;
12
use
Bitrix\Main\ORM\Query\Join
;
13
use
Bitrix\Main\Type\DateTime
;
14
45
class
LinkFileTable
extends
DataManager
46
{
47
use DeleteByFilterTrait;
48
54
public
static
function
getTableName
()
55
{
56
return
'b_im_link_file'
;
57
}
58
64
public
static
function
getMap
()
65
{
66
return
[
67
'ID'
=>
new
IntegerField
(
68
'ID'
,
69
[
70
'primary'
=>
true
,
71
'autocomplete'
=>
true
,
72
]
73
),
74
'MESSAGE_ID'
=>
new
IntegerField
(
75
'MESSAGE_ID'
,
76
[
77
]
78
),
79
'CHAT_ID'
=>
new
IntegerField
(
80
'CHAT_ID'
,
81
[
82
]
83
),
84
'SUBTYPE'
=>
new
StringField
(
85
'SUBTYPE'
,
86
[
87
'validation'
=> [__CLASS__,
'validateSubtype'
],
88
]
89
),
90
'DISK_FILE_ID'
=>
new
IntegerField
(
91
'DISK_FILE_ID'
,
92
[
93
]
94
),
95
'DATE_CREATE'
=>
new
DatetimeField
(
96
'DATE_CREATE'
,
97
[
98
'required'
=>
true
,
99
'default_value'
=>
static
function
() {
100
return
new
DateTime
();
101
}
102
]
103
),
104
'AUTHOR_ID'
=>
new
IntegerField
(
105
'AUTHOR_ID'
,
106
[
107
'required'
=>
true
,
108
]
109
),
110
'FILE'
=> (
new
Reference
(
111
'FILE'
,
112
FileTable::class,
113
Join::on(
'this.DISK_FILE_ID'
,
'ref.ID'
)
114
))->configureJoinType(Join::TYPE_INNER),
115
];
116
}
117
123
public
static
function
validateSubtype
(): array
124
{
125
return
[
126
new
LengthValidator
(
null
, 50),
127
];
128
}
129
}
Bitrix\Im\Model\LinkFileTable
Definition
linkfile.php:46
Bitrix\Im\Model\LinkFileTable\validateSubtype
static validateSubtype()
Definition
linkfile.php:123
Bitrix\Im\Model\LinkFileTable\getMap
static getMap()
Definition
linkfile.php:64
Bitrix\Im\Model\LinkFileTable\getTableName
static getTableName()
Definition
linkfile.php:54
Bitrix\Main\ORM\Data\DataManager
Definition
datamanager.php:33
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\LengthValidator
Definition
lengthvalidator.php:19
Bitrix\Main\ORM\Query\Join
Definition
join.php:19
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Im\Model
Definition
alias.php:2
modules
im
lib
model
linkfile.php
Создано системой
1.10.0