Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
file.php
1<?php
2namespace Bitrix\Main;
3
7
44class 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}
static getMap()
Definition file.php:61
static validateOriginalName()
Definition file.php:161
static validateExternalId()
Definition file.php:197
static validateDescription()
Definition file.php:173
static validateContentType()
Definition file.php:125
static add(array $data)
Definition file.php:213
static validateFileName()
Definition file.php:149
static validateModuleId()
Definition file.php:113
static validateSubdir()
Definition file.php:137
static update($primary, array $data)
Definition file.php:228
static getTableName()
Definition file.php:51
static validateHandlerId()
Definition file.php:185