Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
filetemporary.php
1<?php
2namespace Bitrix\Im\Model;
3
5use Bitrix\Main\ORM\Data\Internal\DeleteByFilterTrait;
11
40{
41 use DeleteByFilterTrait;
42
48 public static function getTableName()
49 {
50 return 'b_im_file_temporary';
51 }
52
58 public static function getMap()
59 {
60 return [
61 'ID' => new IntegerField(
62 'ID',
63 [
64 'primary' => true,
65 'autocomplete' => true,
66 ]
67 ),
68 'DISK_FILE_ID' => new IntegerField(
69 'DISK_FILE_ID',
70 [
71 'required' => true,
72 ]
73 ),
74 'DATE_CREATE' => new DatetimeField(
75 'DATE_CREATE',
76 [
77 'required' => true,
78 'default_value' => static function() {
79 return new DateTime();
80 }
81 ]
82 ),
83 'SOURCE' => new StringField(
84 'SOURCE',
85 [
86 'required' => true,
87 'validation' => [__CLASS__, 'validateSource'],
88 ]
89 ),
90 ];
91 }
92
98 public static function validateSource(): array
99 {
100 return [
101 new LengthValidator(null, 50),
102 ];
103 }
104}