- Модуль: imopenlines
- Путь к файлу: ~/bitrix/modules/imopenlines/lib/operator.php
- Класс: BitrixImOpenLinesOperator
- Вызов: Operator::__construct
public function __construct($chatId, $userId = null)
{
$imLoad = Loader::includeModule('im');
$pullLoad = Loader::includeModule('pull');
if ($imLoad && $pullLoad)
{
$this->error = new BasicError(null, '', '');
$this->moduleLoad = true;
}
else
{
if (!$imLoad)
{
$this->error = new BasicError(__METHOD__, 'IM_LOAD_ERROR', Loc::getMessage('IMOL_OPERATOR_ERROR_IM_LOAD'));
}
elseif (!$pullLoad)
{
$this->error = new BasicError(__METHOD__, 'IM_LOAD_ERROR', Loc::getMessage('IMOL_OPERATOR_ERROR_PULL_LOAD'));
}
}
$this->chatId = intval($chatId);
if (is_null($userId))
{
$userId = $GLOBALS['USER']->GetId();
}
$this->userId = intval($userId);
}