• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/task.php
  • Класс: CTasks
  • Вызов: CTasks::getManifest
static function getManifest()
{
	static $fieldMap;

	if ($fieldMap == null)
	{
		$fieldMap = static::getPublicFieldMap();
	}

	static $fieldManifest;

	if ($fieldManifest === null)
	{
		foreach ($fieldMap as $field => $permissions)
		{
			if ($permissions[0]) // read
			{
				$fieldManifest['READ'][] = $field;
			}

			if ($permissions[1]) // write
			{
				$fieldManifest['WRITE'][] = $field;
			}

			if ($permissions[2]) // sort
			{
				$fieldManifest['SORT'][] = $field;
			}

			if ($permissions[3]) // filter
			{
				$fieldManifest['FILTER'][] = $field;
			}

			if ($permissions[4]) // filter
			{
				$fieldManifest['DATE'][] = $field;
			}
		}
	}

	return ([
		'Manifest version' => '2.1',
		'Warning' => 'don't rely on format of this manifest, it can be changed without any notification',
		'REST: shortname alias to class' => 'items',
		'REST: writable task data fields' => $fieldManifest['WRITE'],
		'REST: readable task data fields' => $fieldManifest['READ'],
		'REST: sortable task data fields' => $fieldManifest['SORT'],
		'REST: filterable task data fields' => $fieldManifest['FILTER'],
		'REST: date fields' => $fieldManifest['DATE'],
		'REST: available methods' => [
			'getlist' => [
				'mandatoryParamsCount' => 0,
				'params' => [
					[
						'description' => 'arOrder',
						'type' => 'array',
						'allowedKeys' => $fieldManifest['SORT'],
					],
					[
						'description' => 'arFilter',
						'type' => 'array',
						'allowedKeys' => $fieldManifest['FILTER'],
						'allowedKeyPrefixes' => [
							'=',
							'!=',
							'%',
							'!%',
							'?',
							'><',
							'!><',
							'>=',
							'>',
							'<',
							'<=',
							'!',
						],
					],
					[
						'description' => 'arSelect',
						'type' => 'array',
						'allowedValues' => $fieldManifest['READ'],
					],
					[
						'description' => 'arParams',
						'type' => 'array',
						'allowedKeys' => ['NAV_PARAMS', 'bGetZombie'],
					],
				],
				'allowedKeysInReturnValue' => $fieldManifest['READ'],
				'collectionInReturnValue' => true,
			],
		],
	]);
}