- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/messagesender/channel.php
- Класс: Bitrix\Crm\MessageSender\Channel
- Вызов: Channel::__construct
public function __construct(string $sender, array $channelInfo, array $fromList, array $toList, int $userId)
{
if (!is_a($sender, ICanSendMessage::class, true))
{
throw new ArgumentTypeException('sender', ICanSendMessage::class);
}
$this->sender = $sender;
$this->channelInfo = $channelInfo;
foreach ($fromList as $from)
{
if (!($from instanceof Correspondents\From))
{
throw new ArgumentTypeException('from', Correspondents\From::class);
}
$this->fromList[] = $from;
}
foreach ($toList as $to)
{
if (!($to instanceof Correspondents\To))
{
throw new ArgumentTypeException('to', Correspondents\To::class);
}
$this->toList[] = $to;
}
$this->userId = $userId;
}