1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
contactlist.php
См. документацию.
1<?php
8namespace Bitrix\Sender;
9
10use Bitrix\Main\Entity;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\ORM\Query\Query;
13use Bitrix\Main\Type as MainType;
14
15Loc::loadMessages(__FILE__);
16
34{
40 public static function getTableName()
41 {
42 return 'b_sender_contact_list';
43 }
44
50 public static function getMap()
51 {
52 return array(
53 'CONTACT_ID' => array(
54 'data_type' => 'integer',
55 'primary' => true,
56 ),
57 'LIST_ID' => array(
58 'data_type' => 'integer',
59 'primary' => true,
60 ),
61 'LIST' => array(
62 'data_type' => 'Bitrix\Sender\ListTable',
63 'reference' => array('=this.LIST_ID' => 'ref.ID'),
64 ),
65 'CONTACT' => array(
66 'data_type' => 'Bitrix\Sender\ContactTable',
67 'reference' => array('=this.CONTACT_ID' => 'ref.ID'),
68 ),
69 );
70 }
71
79 public static function addIfNotExist($contactId, $listId)
80 {
81 $result = false;
82 $arPrimary = array('CONTACT_ID' => $contactId, 'LIST_ID' => $listId);
83 if( !($arList = static::getRowById($arPrimary) ))
84 {
85 $resultAdd = static::add($arPrimary);
86 if ($resultAdd->isSuccess())
87 {
88 $result = true;
89 }
90 }
91 else
92 {
93 $result = true;
94 }
95
96 return $result;
97 }
98
105 public static function deleteList(array $filter)
106 {
107 $entity = static::getEntity();
108 $connection = $entity->getConnection();
109
110 \CTimeZone::disable();
111 $sql = sprintf(
112 'DELETE FROM %s WHERE %s',
113 $connection->getSqlHelper()->quote($entity->getDbTableName()),
114 Query::buildFilterSql($entity, $filter)
115 );
116 $res = $connection->query($sql);
117 \CTimeZone::enable();
118
119 return $res;
120 }
121}
$connection
Определения actionsdefinitions.php:38
static getMap()
Определения contactlist.php:50
static deleteList(array $filter)
Определения contactlist.php:105
static addIfNotExist($contactId, $listId)
Определения contactlist.php:79
static getTableName()
Определения contactlist.php:40
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$result
Определения get_property_values.php:14
$filter
Определения iblock_catalog_list.php:54