• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/operator.php
  • Класс: BitrixImOpenLinesOperator
  • Вызов: Operator::createLead
public function createLead(): Result
{
	$result = new Result();

	$access = $this->checkAccess();
	if ($access['RESULT'])
	{
		$chat = new Chat($this->chatId);
		$resultCreateLead = $chat->createLead($this->userId);

		if(!$resultCreateLead->isSuccess())
		{
			$result->addErrors($resultCreateLead->getErrors());
		}
	}
	else
	{
		$result->addError(new Error($this->getError()->msg, $this->getError()->code, __METHOD__, ['USER_ID' => $this->userId, 'CHAT_ID' => $this->chatId]));
	}

	return $result;
}