Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
file.php
1
<?php
2
namespace
Bitrix\Main
;
3
4
use
Bitrix\Main\ORM\Fields
;
5
use
Bitrix\Main\ORM\Query
;
6
use
Bitrix\Main\File\Internal
;
7
44
class
FileTable
extends
Entity\DataManager
45
{
51
public
static
function
getTableName
()
52
{
53
return
'b_file'
;
54
}
55
61
public
static
function
getMap
()
62
{
63
return
array(
64
'ID'
=>
new
Entity
\
IntegerField
(
'ID'
, array(
65
'primary'
=>
true
,
66
'autocomplete'
=>
true
,
67
)),
68
'TIMESTAMP_X'
=>
new
Entity
\
DatetimeField
(
'TIMESTAMP_X'
, array(
69
'default_value'
=>
new
Type
\
DateTime
70
)),
71
'MODULE_ID'
=>
new
Entity
\
StringField
(
'MODULE_ID'
, array(
72
'validation'
=> array(__CLASS__,
'validateModuleId'
),
73
)),
74
'HEIGHT'
=>
new
Entity
\
IntegerField
(
'HEIGHT'
),
75
'WIDTH'
=>
new
Entity
\
IntegerField
(
'WIDTH'
),
76
'FILE_SIZE'
=>
new
Entity
\
IntegerField
(
'FILE_SIZE'
),
77
'CONTENT_TYPE'
=>
new
Entity
\
StringField
(
'CONTENT_TYPE'
, array(
78
'validation'
=> array(__CLASS__,
'validateContentType'
),
79
)),
80
'SUBDIR'
=>
new
Entity
\
StringField
(
'SUBDIR'
, array(
81
'validation'
=> array(__CLASS__,
'validateSubdir'
),
82
)),
83
'FILE_NAME'
=>
new
Entity
\
StringField
(
'FILE_NAME'
, array(
84
'validation'
=> array(__CLASS__,
'validateFileName'
),
85
'required'
=>
true
,
86
)),
87
'ORIGINAL_NAME'
=>
new
Entity
\
StringField
(
'ORIGINAL_NAME'
, array(
88
'validation'
=> array(__CLASS__,
'validateOriginalName'
),
89
)),
90
'DESCRIPTION'
=>
new
Entity
\
StringField
(
'DESCRIPTION'
, array(
91
'validation'
=> array(__CLASS__,
'validateDescription'
),
92
)),
93
'HANDLER_ID'
=>
new
Entity
\
StringField
(
'HANDLER_ID'
, array(
94
'validation'
=> array(__CLASS__,
'validateHandlerId'
),
95
)),
96
'EXTERNAL_ID'
=>
new
Entity
\
StringField
(
'EXTERNAL_ID'
, array(
97
'validation'
=> array(__CLASS__,
'validateExternalId'
),
98
)),
99
(
new
Fields\Relations\
Reference
(
100
'HASH'
,
101
Internal\FileHashTable::class,
102
Query
\Join::on(
'this.ID'
,
'ref.FILE_ID'
)
103
))
104
->configureJoinType(
Query
\Join::TYPE_LEFT),
105
);
106
}
107
113
public
static
function
validateModuleId
()
114
{
115
return
array(
116
new
Entity
\Validator\Length(
null
, 50),
117
);
118
}
119
125
public
static
function
validateContentType
()
126
{
127
return
array(
128
new
Entity
\Validator\Length(
null
, 255),
129
);
130
}
131
137
public
static
function
validateSubdir
()
138
{
139
return
array(
140
new
Entity
\Validator\Length(
null
, 255),
141
);
142
}
143
149
public
static
function
validateFileName
()
150
{
151
return
array(
152
new
Entity
\Validator\Length(
null
, 255),
153
);
154
}
155
161
public
static
function
validateOriginalName
()
162
{
163
return
array(
164
new
Entity
\Validator\Length(
null
, 255),
165
);
166
}
167
173
public
static
function
validateDescription
()
174
{
175
return
array(
176
new
Entity
\Validator\Length(
null
, 255),
177
);
178
}
179
185
public
static
function
validateHandlerId
()
186
{
187
return
array(
188
new
Entity
\Validator\Length(
null
, 50),
189
);
190
}
191
197
public
static
function
validateExternalId
()
198
{
199
return
array(
200
new
Entity
\Validator\Length(
null
, 50),
201
);
202
}
203
213
public
static
function
add
(array $data)
214
{
215
throw
new
NotImplementedException
(
"Use CFile class."
);
216
}
217
228
public
static
function
update
($primary, array $data)
229
{
230
throw
new
NotImplementedException
(
"Use CFile class."
);
231
}
232
242
public
static
function
delete
($primary)
243
{
244
throw
new
NotImplementedException
(
"Use CFile class."
);
245
}
246
}
Bitrix\Main\FileTable
Definition
file.php:45
Bitrix\Main\FileTable\getMap
static getMap()
Definition
file.php:61
Bitrix\Main\FileTable\validateOriginalName
static validateOriginalName()
Definition
file.php:161
Bitrix\Main\FileTable\validateExternalId
static validateExternalId()
Definition
file.php:197
Bitrix\Main\FileTable\validateDescription
static validateDescription()
Definition
file.php:173
Bitrix\Main\FileTable\validateContentType
static validateContentType()
Definition
file.php:125
Bitrix\Main\FileTable\add
static add(array $data)
Definition
file.php:213
Bitrix\Main\FileTable\validateFileName
static validateFileName()
Definition
file.php:149
Bitrix\Main\FileTable\validateModuleId
static validateModuleId()
Definition
file.php:113
Bitrix\Main\FileTable\validateSubdir
static validateSubdir()
Definition
file.php:137
Bitrix\Main\FileTable\update
static update($primary, array $data)
Definition
file.php:228
Bitrix\Main\FileTable\getTableName
static getTableName()
Definition
file.php:51
Bitrix\Main\FileTable\validateHandlerId
static validateHandlerId()
Definition
file.php:185
Bitrix\Main\NotImplementedException
Definition
exception.php:147
Bitrix\Main\ORM\Entity
Definition
entity.php:26
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\Query\Query
Definition
query.php:118
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Main\File\Internal
Definition
FileDuplicateTable.php:8
Bitrix\Main\ORM\Fields
Definition
arrayfield.php:9
Bitrix\Main\ORM\Query
Definition
chain.php:3
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Main
modules
main
lib
file.php
Создано системой
1.10.0