Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
messageutm.php
1<?php
9
12
13Loc::loadMessages(__FILE__);
14
32class MessageUtmTable extends Entity\DataManager
33{
39 public static function getTableName()
40 {
41 return 'b_sender_message_utm';
42 }
43
49 public static function getMap()
50 {
51 return array(
52 'MESSAGE_ID' => array(
53 'data_type' => 'integer',
54 'required' => true,
55 'primary' => true,
56 ),
57 'CODE' => array(
58 'data_type' => 'string',
59 'required' => true,
60 'primary' => true,
61 ),
62 'VALUE' => array(
63 'data_type' => 'text',
64 'required' => true,
65 ),
66 'MESSAGE' => array(
67 'data_type' => MessageTable::class,
68 'reference' => array('=this.MESSAGE_ID' => 'ref.ID'),
69 ),
70 );
71 }
72
79 public static function deleteByMessageId($messageId)
80 {
81 $items = static::getList(
82 [
83 'select' => ['MESSAGE_ID', 'CODE'],
84 'filter' => ['=MESSAGE_ID' => $messageId]
85 ]
86 );
87 foreach ($items as $primary)
88 {
89 $result = static::delete($primary);
90 if (!$result->isSuccess())
91 {
92 return false;
93 }
94 }
95
96 return true;
97 }
98}
static loadMessages($file)
Definition loc.php:64