Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
messageparam.php
1<?php
2namespace Bitrix\Im\Model;
3
6
7
35class MessageParamTable extends Entity\DataManager
36{
42 public static function getTableName()
43 {
44 return 'b_im_message_param';
45 }
46
52 public static function getMap()
53 {
54 return array(
55 'ID' => array(
56 'data_type' => 'integer',
57 'primary' => true,
58 'autocomplete' => true,
59 //'title' => Loc::getMessage('MESSAGE_PARAM_ENTITY_ID_FIELD'),
60 ),
61 'MESSAGE_ID' => array(
62 'data_type' => 'integer',
63 'required' => true,
64 //'title' => Loc::getMessage('MESSAGE_PARAM_ENTITY_MESSAGE_ID_FIELD'),
65 ),
66 'PARAM_NAME' => array(
67 'data_type' => 'string',
68 'required' => true,
69 'validation' => array(__CLASS__, 'validateParamName'),
70 //'title' => Loc::getMessage('MESSAGE_PARAM_ENTITY_PARAM_NAME_FIELD'),
71 ),
72 'PARAM_VALUE' => array(
73 'data_type' => 'string',
74 'validation' => array(__CLASS__, 'validateParamValue'),
75 //'title' => Loc::getMessage('MESSAGE_PARAM_ENTITY_PARAM_VALUE_FIELD'),
76 'save_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getSaveModificator'),
77 'fetch_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getFetchModificator'),
78 ),
79 'PARAM_JSON' => array(
80 'data_type' => 'text',
81 //'title' => Loc::getMessage('MESSAGE_PARAM_ENTITY_PARAM_JSON_FIELD'),
82 'save_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getSaveModificator'),
83 'fetch_data_modification' => array('\Bitrix\Main\Text\Emoji', 'getFetchModificator'),
84 ),
85 'MESSAGE' => array(
86 'data_type' => 'Bitrix\Im\Model\MessageTable',
87 'reference' => array('=this.MESSAGE_ID' => 'ref.ID'),
88 'join_type' => 'INNER',
89 ),
90 );
91 }
97 public static function validateParamName()
98 {
99 return array(
100 new Entity\Validator\Length(null, 100),
101 );
102 }
108 public static function validateParamValue()
109 {
110 return array(
111 new Entity\Validator\Length(null, 100),
112 );
113 }
114
120 public static function deleteBatch(array $filter)
121 {
122 $whereSql = \Bitrix\Main\Entity\Query::buildFilterSql(static::getEntity(), $filter);
123
124 if ($whereSql <> '')
125 {
126 $tableName = static::getTableName();
127 $connection = Main\Application::getConnection();
128 $connection->queryExecute("DELETE FROM {$tableName} WHERE {$whereSql}");
129 }
130 }
131}
static deleteBatch(array $filter)