7use Bitrix\Im\Model\EO_MessageParam;
12use Bitrix\Im\V2\Common\ActiveRecordImplementation;
13use Bitrix\Im\V2\Common\RegistryEntryImplementation;
20 use ActiveRecordImplementation
24 use RegistryEntryImplementation;
69 $result = $this->defaultLoad($source);
70 if ($result->isSuccess())
74 if ($this->type !== $checkType)
80 if (isset($type[
'loadValueFilter']) && is_callable($type[
'loadValueFilter']))
82 $this->value = \call_user_func($type[
'loadValueFilter'], $this->value);
105 $this->value = (int)
$value;
108 case self::TYPE_BOOL:
111 $this->value =
$value ===
'Y';
115 $this->value = (bool)
$value;
119 case self::TYPE_STRING:
120 $this->value = (string)
$value;
143 if ($this->defaultValue ===
null)
146 if (isset($type[
'default']))
148 $value = $type[
'default'];
153 $this->defaultValue = (int)
$value;
156 case self::TYPE_BOOL:
157 $this->defaultValue = (bool)
$value;
160 case self::TYPE_STRING:
161 $this->defaultValue = (string)
$value;
165 $this->defaultValue =
$value;
170 return $this->defaultValue;
178 return $this->value !==
null;
186 if ($this->value ===
null)
193 return (
int)$this->value;
195 case self::TYPE_BOOL:
196 if (is_string($this->value))
198 $this->value = $this->value ===
'Y';
200 return (
bool)$this->value;
202 case self::TYPE_STRING:
203 return (
string)$this->value;
247 case self::TYPE_BOOL:
248 return $this->
getValue() ?
'Y' :
'N';
253 case self::TYPE_STRING:
276 $this->paramId = $paramId;
283 return $this->paramId;
288 if ($this->messageId != $messageId)
292 $this->messageId = $messageId;
298 return $this->messageId;
303 $name = mb_substr(trim($name), 0, 100);
304 if ($this->name != $name)
330 if ($this->type != $type)
346 if (empty($this->type) && !empty($this->name))
357 $this->jsonValue =
$value;
365 return $this->jsonValue;
380 'field' =>
'paramId',
381 'get' =>
'getParamId',
382 'set' =>
'setParamId',
385 'field' =>
'messageId',
386 'set' =>
'setMessageId',
387 'get' =>
'getMessageId',
402 'saveFilter' =>
'saveValueFilter',
403 'loadFilter' =>
'loadValueFilter',
406 'field' =>
'jsonValue',
407 'set' =>
'setJsonValue',
408 'get' =>
'getJsonValue',
409 'saveFilter' =>
'saveJsonFilter',
410 'loadFilter' =>
'loadJsonFilter',
420 return MessageParamTable::class;
454 isset($type[
'saveValueFilter'])
455 && ($saveFilter = $type[
'saveValueFilter'])
458 if (is_string($saveFilter) && is_callable([$this, $saveFilter]))
462 elseif (is_callable($saveFilter))
484 isset($type[
'loadValueFilter'])
485 && ($loadFilter = $type[
'loadValueFilter'])
488 if (is_string($loadFilter) && is_callable([$this, $loadFilter]))
492 elseif (is_callable($loadFilter))
setPrimaryId(int $primaryId)
__construct($source=null)
setMessageId(int $messageId)
static mirrorDataEntityFields()
static getType(string $paramName)