- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/agent.php
- Класс: BitrixLandingAgent
- Вызов: Agent::addUniqueAgent
static function addUniqueAgent(
string $funcName,
array $params = [],
int $time = 7200,
?int $nextExecDelay = null
): void
{
if (!method_exists(__CLASS__, $funcName))
{
return;
}
$funcName = __CLASS__ . '::' . $funcName . '(';
foreach ($params as $value)
{
if (is_int($value))
{
$funcName .= $value . ',';
}
else if (is_string($value))
{
$funcName .= ''' . $value . ''' . ',';
}
}
$funcName = trim($funcName, ',');
$funcName .= ');';
$res = CAgent::getList(
[],
[
'MODULE_ID' => 'landing',
'NAME' => $funcName
]
);
if (!$res->fetch())
{
if ($nextExecDelay)
{
CAgent::addAgent($funcName,
'landing',
'N',
$time,
'',
'Y',
ConvertTimeStamp(time() + CTimeZone::GetOffset() + $nextExecDelay, "FULL"));
}
else
{
CAgent::addAgent($funcName, 'landing', 'N', $time);
}
}
}