• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/rest/elapsedtime.php
  • Класс: BitrixTasksIntegrationRestElapsedTimeTable
  • Вызов: ElapsedTimeTable::parseOutSimpleAggregations
static function parseOutSimpleAggregations(array $list, array &$runtime)
{
	$legalFuncs = array('MAX', 'MIN', 'SUM', 'COUNT', 'AVG');

	foreach($list as $key)
	{
		$key = (string) trim(ToUpper($key));
		if($key != '')
		{
			$found = array();
			if(preg_match('#^([A-Z0-9_]+)_((MAX|MIN|SUM|COUNT|AVG){1})$#', $key, $found) !== false)
			{
				$field = (string)($found[1] ?? null);
				$func = (string)($found[3] ?? null);

				if($field != '' && $func != '')
				{
					$runtime[$key] = array(
						'data_type' => 'integer',
						'expression' => array(
							$func.'(%s)',
							$field
						)
					);
				}
			}
		}
	}
}