1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
mailentityoptions.php
См. документацию.
1<?php
2
3namespace Bitrix\Mail\Internals;
4
5use Bitrix\Main\Entity;
6use Bitrix\Main\ORM;
7use Bitrix\Main\Type\DateTime;
8
26{
27 const DIR_TYPE_NAME = 'DIR';
28 const MAILBOX_TYPE_NAME = 'MAILBOX';
29 const MESSAGE_TYPE_NAME = 'MESSAGE';
30
31 const CONNECT_ERROR_ATTEMPT_COUNT_PROPERTY_NAME = 'CONNECT_ERROR_ATTEMPT_COUNT';
32 const SYNC_STATUS_PROPERTY_NAME = 'SYNC_STATUS';
33
34 public static function add($fields)
35 {
36 try {
37 return parent::add($fields);
38 } catch (\Exception $exception)
39 {
40 //key conflict
41 }
42 }
43
44 public static function deleteList(array $filter)
45 {
46 $entity = static::getEntity();
47 $connection = $entity->getConnection();
48
49 return $connection->query(sprintf(
50 'DELETE FROM %s WHERE %s',
51 $connection->getSqlHelper()->quote($entity->getDbTableName()),
52 ORM\Query\Query::buildFilterSql($entity, $filter)
53 ));
54 }
55
56 public static function getFilePath()
57 {
58 return __FILE__;
59 }
60
61 public static function getTableName()
62 {
63 return 'b_mail_entity_options';
64 }
65
66 public static function insertIgnore(
67 int $mailboxId,
68 int $entityId,
69 string $entityType,
70 string $propertyName,
71 string $value,
72 DateTime $dataInsert = new DateTime()
73 ): void
74 {
75 $connection = self::getEntity()->getConnection();
76 $sqlHelper = $connection->getSqlHelper();
77
78 [$columns, $insert] = $sqlHelper->prepareInsert(self::getTableName(),
79 [
80 'MAILBOX_ID' => $mailboxId,
81 'ENTITY_TYPE' => $entityType,
82 'ENTITY_ID' => $entityId,
83 'PROPERTY_NAME' => $propertyName,
84 'DATE_INSERT' => $dataInsert,
85 'VALUE' => $value,
86 ]
87 );
88
89 $connection->queryExecute(
90 $sqlHelper->getInsertIgnore(
92 "($columns)",
93 "VALUES($insert)"
94 )
95 );
96 }
97
98 public static function getMap()
99 {
100 return array(
101 'MAILBOX_ID' => array(
102 'data_type' => 'integer',
103 'required' => true,
104 'primary' => true,
105 ),
106 'ENTITY_TYPE' => array(
107 'data_type' => 'enum',
108 'values' => array(self::DIR_TYPE_NAME, self::MAILBOX_TYPE_NAME, self::MESSAGE_TYPE_NAME),
109 'required' => true,
110 'primary' => true,
111 ),
112 'ENTITY_ID' => array(
113 'data_type' => 'string',
114 'required' => true,
115 'primary' => true,
116 ),
117 'PROPERTY_NAME' => array(
118 'data_type' => 'string',
119 'required' => true,
120 'primary' => true,
121 ),
122 'VALUE' => array(
123 'data_type' => 'string',
124 ),
125 'DATE_INSERT' => array(
126 'data_type' => 'datetime',
127 ),
128 );
129 }
130}
$connection
Определения actionsdefinitions.php:38
static deleteList(array $filter)
Определения mailentityoptions.php:44
static insertIgnore(int $mailboxId, int $entityId, string $entityType, string $propertyName, string $value, DateTime $dataInsert=new DateTime())
Определения mailentityoptions.php:66
static getEntity()
Определения datamanager.php:65
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$filter
Определения iblock_catalog_list.php:54
Определения chain.php:3
$entityId
Определения payment.php:4
$fields
Определения yandex_run.php:501