• Модуль: abtest
  • Путь к файлу: ~/bitrix/modules/abtest/lib/helper.php
  • Класс: BitrixABTestHelper
  • Вызов: Helper::stopTest
static function stopTest($id, $auto = false)
{
	global $USER;

	if ($abtest = ABTestTable::getById($id)->fetch())
	{
		$fields = array(
			'STOP_DATE' => new TypeDateTime(),
			'ACTIVE'    => 'N',
		);

		if (!$auto)
			$fields['USER_ID'] = $USER->getID();

		$result = ABTestTable::update(intval($id), $fields);

		if ($result->isSuccess())
		{
			Helper::clearCache($abtest['SITE_ID']);

			return true;
		}
	}

	return false;
}