Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
sharinglinktable.php
1<?php
3
4use Bitrix\Main\Entity\TextField;
12
44{
50 public static function getTableName()
51 {
52 return 'b_calendar_sharing_link';
53 }
54
60 public static function getMap()
61 {
62 return [
63 new IntegerField(
64 'ID',
65 [
66 'primary' => true,
67 'autocomplete' => true,
68 ]
69 ),
70 new IntegerField(
71 'OBJECT_ID',
72 [
73 'required' => true,
74 ]
75 ),
76 new StringField(
77 'OBJECT_TYPE',
78 [
79 'required' => true,
80 'validation' => [__CLASS__, 'validateObjectType'],
81 ]
82 ),
83 new StringField(
84 'HASH',
85 [
86 'required' => true,
87 'validation' => [__CLASS__, 'validateHash'],
88 ]
89 ),
90 new TextField('OPTIONS'),
91 new BooleanField(
92 'ACTIVE',
93 [
94 'values' => array('N', 'Y'),
95 'default' => 'Y',
96 ]
97 ),
98 new DatetimeField(
99 'DATE_CREATE',
100 [
101 'required' => true,
102 ]
103 ),
104 ];
105 }
106
112 public static function validateObjectType(): array
113 {
114 return [
115 new LengthValidator(null, 32),
116 ];
117 }
118
124 public static function validateHash(): array
125 {
126 return [
127 new LengthValidator(null, 64),
128 ];
129 }
130}