Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sharinglinktable.php
1<?php
3
4use Bitrix\Main\Entity\ReferenceField;
5use Bitrix\Main\Entity\TextField;
15
55{
61 public static function getTableName()
62 {
63 return 'b_calendar_sharing_link';
64 }
65
71 public static function getMap()
72 {
73 return [
74 (new IntegerField('ID',
75 []
76 ))
77 ->configurePrimary(true)
78 ->configureAutocomplete(true)
79 ,
80 (new IntegerField('OBJECT_ID',
81 []
82 ))
83 ->configureRequired(true)
84 ,
85 (new StringField('OBJECT_TYPE',
86 [
87 'validation' => [__CLASS__, 'validateObjectType']
88 ]
89 ))
90 ->configureRequired(true)
91 ,
92 (new StringField('HASH',
93 [
94 'validation' => [__CLASS__, 'validateHash']
95 ]
96 ))
97 ->configureRequired(true)
98 ,
99 (new TextField('OPTIONS',
100 []
101 ))
102 ,
103 (new BooleanField('ACTIVE',
104 []
105 ))
106 ->configureValues('N', 'Y')
107 ->configureDefaultValue('Y')
108 ,
109 (new DatetimeField('DATE_CREATE',
110 []
111 ))
112 ->configureRequired(true)
113 ,
114 (new DatetimeField('DATE_EXPIRE',
115 []
116 ))
117 ,
118 (new IntegerField('HOST_ID',
119 []
120 ))
121 ,
122 (new IntegerField('OWNER_ID',
123 []
124 ))
125 ,
126 (new StringField('CONFERENCE_ID',
127 [
128 'validation' => [__CLASS__, 'validateConferenceId']
129 ]
130 ))
131 ,
132 (new StringField('PARENT_LINK_HASH',
133 [
134 'validation' => [__CLASS__, 'validateParentLinkHash']
135 ]
136 ))
137 ,
138 (new IntegerField('CONTACT_ID',
139 []
140 ))
141 ->configureNullable()
142 ,
143 (new IntegerField('CONTACT_TYPE',
144 []
145 ))
146 ->configureNullable()
147 ,
148 (new StringField('MEMBERS_HASH',
149 [
150 'validation' => [__CLASS__, 'validateMembersHash']
151 ]
152 ))
153 ,
154 (new IntegerField('FREQUENT_USE',
155 []
156 ))
157 ,
158 (new OneToMany(
159 'MEMBERS',
160 SharingLinkMemberTable::class,
161 'MEMBER',
162 ))
163 ->configureJoinType(Join::TYPE_LEFT),
164 ];
165 }
166
172 public static function validateObjectType(): array
173 {
174 return [
175 new LengthValidator(null, 32),
176 ];
177 }
178
184 public static function validateHash(): array
185 {
186 return [
187 new LengthValidator(null, 64),
188 ];
189 }
190
196 public static function validateConferenceId(): array
197 {
198 return [
199 new LengthValidator(null, 64),
200 ];
201 }
202
208 public static function validateParentLinkHash(): array
209 {
210 return [
211 new LengthValidator(null, 64),
212 ];
213 }
214
220 public static function validateMembersHash(): array
221 {
222 return [
223 new LengthValidator(null, 64),
224 ];
225 }
226
227}