Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
tasktable.php
1<?php
2
4
13
31{
32 public static function getTableName(): string
33 {
34 return 'b_bp_task';
35 }
36
37 public static function getObjectClass()
38 {
39 return Task::class;
40 }
41
42 public static function getMap(): array
43 {
44 return [
45 (new Entity\IntegerField('ID'))
46 ->configurePrimary()
47 ->configureAutocomplete(),
48
49 (new Entity\StringField('WORKFLOW_ID'))
50 ->addValidator(new LengthValidator(1, 32)),
51
52 (new Entity\StringField('ACTIVITY'))
53 ->addValidator(new LengthValidator(1, 128)),
54
55 (new Entity\StringField('ACTIVITY_NAME'))
56 ->addValidator(new LengthValidator(1, 128)),
57
58 (new Entity\DatetimeField('CREATED_DATE'))->configureNullable(),
59
60 (new Entity\DatetimeField('MODIFIED')),
61
62 (new Entity\DatetimeField('OVERDUE_DATE'))
63 ->configureNullable(),
64
65 (new Entity\StringField('NAME'))
66 ->addValidator(new LengthValidator(1, 128)),
67
68 (new Entity\TextField('DESCRIPTION'))
69 ->configureNullable(),
70
71 (new ArrayField('PARAMETERS'))
72 ->configureSerializeCallback(static fn($value) => serialize($value))
73 ->configureUnserializeCallback(
74 static fn($value) => unserialize(
75 $value,
76 [
77 'allowed_classes' => [
78 \Bitrix\Bizproc\BaseType\Value\Date::class,
79 \Bitrix\Bizproc\BaseType\Value\DateTime::class,
80 \Bitrix\Main\Type\Date::class,
81 \Bitrix\Main\Type\DateTime::class,
82 \DateTime::class,
83 \DateTimeZone::class,
84 \Bitrix\Main\Web\Uri::class,
85 ]
86 ]
87 )
88 )
89 ,
90
91 (new Entity\IntegerField('STATUS'))
92 ->configureDefaultValue(0),
93
94 (new Entity\EnumField('IS_INLINE'))
95 ->configureValues(['Y', 'N'])
96 ->configureDefaultValue('N'),
97
98 (new Entity\IntegerField('DELEGATION_TYPE'))
99 ->configureDefaultValue(0),
100
101 (new Entity\StringField('DOCUMENT_NAME'))
102 ->addValidator(new LengthValidator(1, 255)),
103
104 new \Bitrix\Main\ORM\Fields\Relations\Reference(
105 'WORKFLOW_STATE',
106 WorkflowStateTable::class,
107 Join::on('this.WORKFLOW_ID', 'ref.ID')
108 ),
109 new \Bitrix\Main\ORM\Fields\Relations\OneToMany(
110 'TASK_USERS',
111 TaskUserTable::class,
112 'USER_TASKS'
113 )
114 ];
115 }
116
122 public static function add(array $data)
123 {
124 throw new NotImplementedException('Use CBPTaskService class.');
125 }
126
133 public static function update($primary, array $data)
134 {
135 throw new NotImplementedException('Use CBPTaskService class.');
136 }
137
143 public static function delete($primary)
144 {
145 throw new NotImplementedException('Use CBPTaskService class.');
146 }
147}
static update($primary, array $data)