1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
list.php
См. документацию.
1<?php
8namespace Bitrix\Sender;
9
10use Bitrix\Main\Entity;
11use Bitrix\Main\Localization\Loc;
12use Bitrix\Main\Type as MainType;
13use Bitrix\Main\DB\SqlExpression;
14
15Loc::loadMessages(__FILE__);
16
34{
40 public static function getTableName()
41 {
42 return 'b_sender_list';
43 }
44
50 public static function getMap()
51 {
52 return array(
53 'ID' => array(
54 'data_type' => 'integer',
55 'autocomplete' => true,
56 'primary' => true,
57 ),
58 'CODE' => array(
59 'data_type' => 'string',
60 'validation' => array(__CLASS__, 'validateCode'),
61 'title' => Loc::getMessage('SENDER_ENTITY_LIST_FIELD_TITLE_CODE'),
62 ),
63 'NAME' => array(
64 'data_type' => 'string',
65 'required' => true,
66 'default_value' => Loc::getMessage(
67 'SENDER_ENTITY_LIST_FIELD_NAME_PATTERN',
68 ['%date%' => Internals\PrettyDate::formatDate()]
69 ),
70 'title' => Loc::getMessage('SENDER_ENTITY_LIST_FIELD_TITLE_NAME'),
71 ),
72 'SORT' => array(
73 'data_type' => 'integer',
74 'default_value' => 100,
75 'required' => true,
76 'title' => Loc::getMessage('SENDER_ENTITY_LIST_FIELD_TITLE_SORT'),
77 ),
78 'CONTACT_LIST' => array(
79 'data_type' => 'Bitrix\Sender\ContactListTable',
80 'reference' => array('=this.ID' => 'ref.LIST_ID'),
81 ),
82 );
83 }
84
90 public static function validateCode()
91 {
92 return array(
93 new Entity\Validator\Length(null, 60),
94 );
95 }
96
103 public static function onAfterDelete(Entity\Event $event)
104 {
106 $data = $event->getParameters();
107
108 $primary = array('LIST_ID' => $data['primary']['ID']);
110
111 return $result;
112 }
113
122 public static function addIfNotExist($code, $name)
123 {
124 $id = false;
125 if( !($arList = static::getList(array('filter' => array('CODE' => $code)))->fetch() ))
126 {
127 $resultAdd = static::add(array('CODE' => $code, 'NAME' => $name));
128 if ($resultAdd->isSuccess())
129 {
130 $id = $resultAdd->getId();
131 }
132 }
133 else
134 {
135 $id = $arList['ID'];
136 }
137
138 return $id;
139 }
140}
Определения event.php:5
static deleteList(array $filter)
Определения contactlist.php:105
Определения list.php:34
static addIfNotExist($code, $name)
Определения list.php:122
static getMap()
Определения list.php:50
static onAfterDelete(Entity\Event $event)
Определения list.php:103
static getTableName()
Определения list.php:40
static validateCode()
Определения list.php:90
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$name
Определения menu_edit.php:35
Определения ufield.php:9
$event
Определения prolog_after.php:141