• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/elapseditem.php
  • Класс: CTaskElapsedItem
  • Вызов: CTaskElapsedItem::getManifest
static function getManifest()
{
	$allKeys = array(
		0 => array(), // readableKeys,
		1 => array(), // writableKeys,
		2 => array(), // sortableKeys,
		3 => array(), // filterableKeys,
		4 => array(), // dateKeys
		5 => array(), // aggregatableKeys
	);

	foreach ($allKeys as $index => $keys)
	{
		foreach ($fieldMap = static::getPublicFieldMap() as $fieldName => $field)
		{
			if ($field[$index] == 1)
			{
				$allKeys[$index][] = $fieldName;
			}
		}
	}

	$readableKeys = $allKeys[0];
	$writableKeys = $allKeys[1];
	$sortableKeys = $allKeys[2];
	$filterableKeys = $allKeys[3];
	$dateKeys = $allKeys[4];
	$aggregatableKeys = $allKeys[5];
	$aggregations = array('MAX', 'MIN', 'COUNT', 'SUM', 'AVG');

	return(array(
		'Manifest version' => '1.2',
		'Manifest change date' => '22 Feb 2018',
		'Warning' => 'Don't rely on format of this manifest, it can be changed without any notifications!',
		'REST: shortname alias to class' => 'elapseditem',
		'REST: writable elapseditem data fields' =>  $writableKeys,
		'REST: readable elapseditem data fields' =>  $readableKeys,
		'REST: sortable elapseditem data fields' =>  $sortableKeys,
		'REST: filterable elapseditem data fields' =>  $filterableKeys,
		'REST: date fields' =>  $dateKeys,
		'REST: available methods' => array(
			'getmanifest' => array(
				'staticMethod' => true,
				'params' => array()
			),
			'getlist' => array(
				'staticMethod' => true,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'order',
						'type' => 'array',
						'allowedKeys' => $sortableKeys
					),
					array(
						'description' => 'filter',
						'type' => 'array',
						'allowedKeys' => $filterableKeys,
						'allowedKeyPrefixes' => array(
							'!', '<=', '<', '>=', '>'
						)
					),
					array(
						'description' => 'select',
						'type' => 'array',
						'allowedValues' => array_merge(array('', '*'), $readableKeys),
						'allowedAggregations' => $aggregations,
						'allowedValuesInAggregation' => $aggregatableKeys
					),
					array(
						'description' => 'params',
						'type' => 'array',
						'allowedKeys' => array('NAV_PARAMS')
					),
				),
				'allowedKeysInReturnValue' => $readableKeys,
				'allowedAggregations' => $aggregations,
				'collectionInReturnValue' => true
			),
			'get' => array(
				'mandatoryParamsCount' => 2,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'itemId',
						'type' => 'integer'
					)
				),
				'allowedKeysInReturnValue' => $readableKeys
			),
			'add' => array(
				'staticMethod' => true,
				'mandatoryParamsCount' => 2,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'fields',
						'type' => 'array',
						'allowedKeys' => $writableKeys
					)
				)
			),
			'update' => array(
				'staticMethod' => false,
				'mandatoryParamsCount' => 3,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'itemId',
						'type' => 'integer'
					),
					array(
						'description' => 'fields',
						'type' => 'array',
						'allowedKeys' => $writableKeys
					)
				)
			),
			'delete' => array(
				'staticMethod' => false,
				'mandatoryParamsCount' => 2,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'itemId',
						'type' => 'integer'
					)
				)
			),
			'isactionallowed' => array(
				'staticMethod' => false,
				'mandatoryParamsCount' => 3,
				'params' => array(
					array(
						'description' => 'taskId',
						'type' => 'integer'
					),
					array(
						'description' => 'itemId',
						'type' => 'integer'
					),
					array(
						'description' => 'actionId',
						'type' => 'integer'
					)
				)
			)
		)
	));
}