Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
status_grouptask.php
1<?php
9
10use Bitrix\Main;
11
28class StatusGroupTaskTable extends Main\Entity\DataManager
29{
30 public static function getFilePath()
31 {
32 return __FILE__;
33 }
34
35 public static function getTableName()
36 {
37 return 'b_sale_status_group_task';
38 }
39
40 public static function getMap()
41 {
42 return array(
43
44 new Main\Entity\StringField('STATUS_ID', array(
45 'primary' => true,
46 'format' => '/^[A-Za-z?0-9]{1,2}$/',
47 )),
48
49 new Main\Entity\IntegerField('GROUP_ID', array(
50 'primary' => true,
51 'format' => '/^[0-9]{1,18}$/',
52 )),
53
54 new Main\Entity\IntegerField('TASK_ID', array(
55 'primary' => true,
56 'format' => '/^[0-9]{1,18}$/',
57 )),
58
59 new Main\Entity\ReferenceField('STATUS', 'Bitrix\Sale\Internals\StatusTable',
60 array('=this.STATUS_ID' => 'ref.ID'),
61 array('join_type' => 'LEFT')
62 ),
63
64 new Main\Entity\ReferenceField('GROUP', 'Bitrix\Main\GroupTable',
65 array('=this.GROUP_ID' => 'ref.ID'),
66 array('join_type' => 'INNER')
67 ),
68
69 new Main\Entity\ReferenceField('TASK', 'Bitrix\Main\TaskTable',
70 array('=this.TASK_ID' => 'ref.ID'),
71 array('join_type' => 'INNER')
72 ),
73
74 );
75 }
76
77 public static function deleteByStatus($statusId)
78 {
79 $result = self::getList(array(
80 'select' => array('STATUS_ID', 'GROUP_ID', 'TASK_ID'),
81 'filter' => array('=STATUS_ID' => $statusId)
82 ));
83 while ($primary = $result->fetch())
84 self::delete($primary);
85 }
86}