Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
groupcontact.php
1<?php
9
13
14Loc::loadMessages(__FILE__);
15
32class GroupContactTable extends Entity\DataManager
33{
39 public static function getTableName()
40 {
41 return 'b_sender_group_contact';
42 }
43
49 public static function getMap()
50 {
51 return array(
52 'ID' => array(
53 'data_type' => 'integer',
54 'autocomplete' => true,
55 'primary' => true,
56 ),
57 'DATE_INSERT' => array(
58 'data_type' => 'datetime',
59 ),
60 'CONTACT' => array(
61 'data_type' => Sender\ContactTable::class,
62 'reference' => array('=this.CONTACT_ID' => 'ref.ID'),
63 ),
64 'CONTACT_ID' => array(
65 'required' => true,
66 'data_type' => 'integer',
67 ),
68 'GROUP_ID' => array(
69 'data_type' => 'integer',
70 'required' => true,
71 'primary' => true,
72 ),
73 'TYPE_ID' => array(
74 'data_type' => 'integer',
75 'required' => true,
76 'primary' => true,
77 ),
78
79 'CNT' => array(
80 'data_type' => 'integer',
81 'required' => true,
82 'default_value' => 0,
83 ),
84 'GROUP' => array(
85 'data_type' => 'Bitrix\Sender\GroupTable',
86 'reference' => array('=this.GROUP_ID' => 'ref.ID'),
87 ),
88 );
89 }
90
97 public static function deleteByGroupId($groupId)
98 {
99 $items = static::getList([
100 'select' => ['ID', 'GROUP_ID', 'TYPE_ID'],
101 'filter' => ['=GROUP_ID' => $groupId]
102 ]);
103 foreach ($items as $primary)
104 {
105 $result = static::delete($primary);
106 if (!$result->isSuccess())
107 {
108 return false;
109 }
110 }
111
112 return true;
113 }
114}
static loadMessages($file)
Definition loc.php:64