3namespace Bitrix\Im\V2\Message\Send;
74 'actual' =>
'generateUrlPreview',
75 'type' => self::TYPE_BOOL,
77 'SKIP_USER_CHECK' => [
78 'actual' =>
'skipUserCheck',
79 'type' => self::TYPE_BOOL,
82 'actual' =>
'sendPush',
83 'type' => self::TYPE_BOOL,
86 'actual' =>
'sendPushImmediately',
87 'type' => self::TYPE_BOOL,
90 'actual' =>
'addRecent',
91 'type' => self::TYPE_BOOL,
93 'RECENT_SKIP_AUTHOR' => [
94 'actual' =>
'skipAuthorAddRecent',
95 'type' => self::TYPE_BOOL,
98 'actual' =>
'convertMode',
99 'type' => self::TYPE_BOOL,
102 'actual' =>
'skipCommandExecution',
103 'type' => self::TYPE_BOOL,
105 'SKIP_COUNTER_INCREMENTS' => [
106 'actual' =>
'skipCounterIncrements',
107 'type' => self::TYPE_BOOL,
109 'SILENT_CONNECTOR' => [
110 'actual' =>
'keepConnectorSilence',
111 'type' => self::TYPE_BOOL,
113 'SKIP_CONNECTOR' => [
114 'actual' =>
'skipConnectorSend',
115 'type' => self::TYPE_BOOL,
117 'IMPORTANT_CONNECTOR' => [
118 'actual' =>
'forceConnectorSend',
119 'type' => self::TYPE_BOOL,
122 'actual' =>
'skipOpenlineSession',
123 'type' => self::TYPE_BOOL,
126 'actual' =>
'fakeRelation',
127 'type' => self::TYPE_INT,
129 'SKIP_URL_INDEX' => [
130 'actual' =>
'skipUrlIndex',
131 'type' => self::TYPE_BOOL,
136 private bool $generateUrlPreview =
true;
142 private bool $skipUserCheck =
false;
145 private bool $sendPush =
true;
148 private bool $sendPushImmediately =
false;
154 private bool $addRecent =
true;
157 private bool $skipAuthorAddRecent =
false;
160 private bool $convertMode =
false;
163 private bool $skipCommandExecution =
false;
165 private bool $skipFireEventBeforeMessageNotifySend =
false;
167 private bool $skipCounterIncrements =
false;
173 private bool $keepConnectorSilence =
false;
179 private bool $skipConnectorSend =
false;
185 private bool $forceConnectorSend =
false;
191 private bool $skipOpenlineSession =
false;
193 private int $fakeRelation = 0;
203 public static function create($sendingConfig): self
205 if ($sendingConfig instanceof
self)
207 return $sendingConfig;
210 if (is_array($sendingConfig))
212 return (
new static($sendingConfig));
220 foreach (
$data as $fieldName => $fieldValue)
222 if (!isset(self::MAP_LEGACY_TO_ACTUAL_FIELD[$fieldName]))
227 $fieldInfo = self::MAP_LEGACY_TO_ACTUAL_FIELD[$fieldName];
228 $actualFieldName = $fieldInfo[
'actual'];
229 $this->{$actualFieldName} = $this->
prepareValue($fieldInfo[
'type'], $actualFieldName, $fieldValue);
235 return $this->skipFireEventBeforeMessageNotifySend;
249 if (isset($this->{$name}))
251 return $this->{$name};
256 if (empty($parseResult))
261 [$fieldName, $fieldValue] = $parseResult;
262 $this->{$fieldName} = $fieldValue;
269 $mapPrefixToArgument = [
274 'set' => $arguments[0] ??
null,
277 foreach ($mapPrefixToArgument as $prefix => $argument)
279 if (str_starts_with(
$name, $prefix))
290 return lcfirst(mb_substr(
$name, mb_strlen($prefix)));
295 $boolAsString =
$options[
'BOOL_AS_STRING'] ??
true;
298 foreach (self::MAP_LEGACY_TO_ACTUAL_FIELD as $legacyFieldName => $fieldInfo)
300 $actualFieldName = $fieldInfo[
'actual'];
301 if ($fieldInfo[
'type'] === self::TYPE_BOOL && $boolAsString)
303 $data[$legacyFieldName] = $this->{$actualFieldName} ?
'Y' :
'N';
307 $data[$legacyFieldName] = $this->{$actualFieldName};
319 self::TYPE_INT => (int)$value,
331 return $value ===
'Y';
toArray(array $options=[])
getFieldNameByFunctionName(string $name, string $prefix)
const MAP_LEGACY_TO_ACTUAL_FIELD
static create($sendingConfig)
__call(string $name, array $arguments)
fillByLegacy(array $data)
isSkipFireEventBeforeMessageNotifySend()
parseFunction(string $name, array $arguments)
__construct(?array $args=null)
prepareValue(string $type, string $key, $value)
skipFireEventBeforeMessageNotifySend(bool $flag=true)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(empty($signedUserToken)) $key