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

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

	list($readableKeys, $writableKeys, $sortableKeys, $dateKeys) = $allKeys;

	return [
		'Manifest version'                         => '2.0',
		'Warning'                                  => 'don't rely on format of this manifest, it can be changed without any notification',
		'REST: shortname alias to class'           => 'checklistitem',
		'REST: writable checklistitem data fields' => $writableKeys,
		'REST: readable checklistitem data fields' => $readableKeys,
		'REST: sortable checklistitem data fields' => $sortableKeys,
		'REST: date fields'                        => $dateKeys,
		'REST: available methods' => [
			'getmanifest'     => [
				'staticMethod' => true,
				'params'       => [],
			],
			'get'             => [
				'mandatoryParamsCount'     => 2,
				'params'                   => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
				],
				'allowedKeysInReturnValue' => $readableKeys,
			],
			'getlist'         => [
				'staticMethod'             => true,
				'mandatoryParamsCount'     => 1,
				'params'                   => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'arOrder',
						'type'        => 'array',
						'allowedKeys' => $sortableKeys,
					],
				],
				'allowedKeysInReturnValue' => $readableKeys,
				'collectionInReturnValue'  => true,
			],
			'add'             => [
				'staticMethod'         => true,
				'mandatoryParamsCount' => 2,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'arFields',
						'type'        => 'array',
						'allowedKeys' => $writableKeys,
					],
				],
			],
			'update'          => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 3,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
					[
						'description' => 'arFields',
						'type'        => 'array',
						'allowedKeys' => $writableKeys,
					],
				],
			],
			'delete'          => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 2,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
				],
			],
			'complete'        => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 2,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
				],
			],
			'renew'           => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 2,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
				],
			],
			'moveafteritem'   => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 3,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
					[
						'description' => 'afterItemId',
						'type'        => 'integer',
					],
				],
			],
			'isactionallowed' => [
				'staticMethod'         => false,
				'mandatoryParamsCount' => 3,
				'params'               => [
					[
						'description' => 'taskId',
						'type'        => 'integer',
					],
					[
						'description' => 'itemId',
						'type'        => 'integer',
					],
					[
						'description' => 'actionId',
						'type'        => 'integer',
					],
				],
			],
		],
	];
}