• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/call.php
  • Класс: BitrixVoximplantCall
  • Вызов: Call::load
static function load($callId)
{
	if(isset(static::$instances[$callId]))
	{
		return static::$instances[$callId];
	}

	$fields = CallTable::getByCallId($callId);
	if(!$fields)
	{
		return false;
	}

	$users = [];
	$cursor = CallUserTable::getList([
		'select' => ['USER_ID', 'ROLE', 'STATUS'],
		'filter' => ['=CALL_ID' => $callId]
	]);

	while ($row = $cursor->fetch())
	{
		$users[$row['USER_ID']] = $row;
	}

	$instance = new static();
	static::$instances[$callId] = $instance;

	$instance->fromArray($fields);
	$instance->users = $users;
	return $instance;
}