Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
restapp.php
1<?php
3
5
23{
27 public static function getTableName(): string
28 {
29 return 'b_messageservice_rest_app';
30 }
31
37 public static function getMap(): array
38 {
39 return [
40 'ID' => [
41 'data_type' => 'integer',
42 'primary' => true,
43 'autocomplete' => true
44 ],
45 'APP_ID' => [
46 'data_type' => 'string',
47 'required' => true,
48 'validation' => [__CLASS__, 'validateVarchar128'],
49 ],
50 'CODE' => [
51 'data_type' => 'string',
52 'required' => true,
53 'validation' => [__CLASS__, 'validateVarchar128'],
54 ],
55 'TYPE' => [
56 'data_type' => 'string',
57 'required' => true,
58 'validation' => [__CLASS__, 'validateType'],
59 ],
60 'HANDLER' => [
61 'data_type' => 'string',
62 'required' => true,
63 'validation' => [__CLASS__, 'validateHandler'],
64 ],
65 'DATE_ADD' => [
66 'data_type' => 'datetime',
67 'default_value' => new Main\Type\DateTime(),
68 ],
69 'AUTHOR_ID' => [
70 'data_type' => 'integer',
71 'default_value' => 0,
72 ],
73 'AUTHOR' => [
74 'data_type' => '\Bitrix\Main\UserTable',
75 'reference' => [
76 '=this.AUTHOR_ID' => 'ref.ID'
77 ],
78 'join_type' => 'LEFT',
79 ],
80 ];
81 }
82
86 public static function validateVarchar128(): array
87 {
88 return [
89 new Main\Entity\Validator\Length(null, 128),
90 ];
91 }
92
96 public static function validateType(): array
97 {
98 return [
99 new Main\Entity\Validator\Length(null, 30),
100 ];
101 }
102
106 public static function validateHandler(): array
107 {
108 return [
109 new Main\Entity\Validator\Length(null, 1000),
110 ];
111 }
112}