• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/commentitem.php
  • Класс: CTaskCommentItem
  • Вызов: CTaskCommentItem::getManifest
static function getManifest()
{
	$arWritableKeys = array('POST_MESSAGE', 'AUTHOR_ID', 'POST_DATE', 'UF_FORUM_MESSAGE_DOC');
	$arDateKeys = array('POST_DATE');
	$arSortableKeys = array('ID', 'AUTHOR_ID', 'AUTHOR_NAME', 'AUTHOR_EMAIL', /*'EDITOR_ID',*/ 'POST_DATE');
	$arReadableKeys = array_merge(
		array('POST_MESSAGE_HTML'),
		$arSortableKeys,
		$arDateKeys,
		$arWritableKeys,
		array('ATTACHED_OBJECTS')
	);
	$arFiltrableKeys = array('ID', 'AUTHOR_ID', 'AUTHOR_NAME', 'POST_DATE');

	return(array(
		'Manifest version' => '1.1',
		'Warning' => 'don't rely on format of this manifest, it can be changed without any notification',
		'REST: shortname alias to class' => 'commentitem',
		'REST: writable commentitem data fields'   =>  $arWritableKeys,
		'REST: readable commentitem data fields'   =>  $arReadableKeys,
		'REST: sortable commentitem data fields'   =>  $arSortableKeys,
		'REST: filterable commentitem data fields' =>  $arFiltrableKeys,
		'REST: date fields' =>  $arDateKeys,
		'REST: available methods' => array(
			'getmanifest' => array(
				'staticMethod' => true,
				'params'       => array()
			),
			'getlist' => array(
				'staticMethod'         =>  true,
				'mandatoryParamsCount' =>  1,
				'params' => array(
					array(
						'description' => 'taskId',
						'type'        => 'integer'
					),
					array(
						'description' => 'arOrder',
						'type'        => 'array',
						'allowedKeys' => $arSortableKeys
					),
					array(
						'description' => 'arFilter',
						'type'        => 'array',
						'allowedKeys' => $arFiltrableKeys,
						'allowedKeyPrefixes' => array(
							'!', '<=', '<', '>=', '>'
						)
					),
				),
				'allowedKeysInReturnValue' => $arReadableKeys,
				'collectionInReturnValue'  => true
			),
			'get' => array(
				'mandatoryParamsCount' => 2,
				'params' => array(
					array(
						'description' => 'taskId',
						'type'        => 'integer'
					),
					array(
						'description' => 'itemId',
						'type'        => 'integer'
					)
				),
				'allowedKeysInReturnValue' => $arReadableKeys
			),
			'add' => array(
				'staticMethod'         => true,
				'mandatoryParamsCount' => 2,
				'params' => array(
					array(
						'description' => 'taskId',
						'type'        => 'integer'
					),
					array(
						'description' => 'arFields',
						'type'        => 'array',
						'allowedKeys' => $arWritableKeys
					)
				)
			),
			'update' => array(
				'staticMethod'         => false,
				'mandatoryParamsCount' => 3,
				'params' => array(
					array(
						'description' => 'taskId',
						'type'        => 'integer'
					),
					array(
						'description' => 'itemId',
						'type'        => 'integer'
					),
					array(
						'description' => 'arFields',
						'type'        => 'array',
						'allowedKeys' => $arWritableKeys
					)
				)
			),
			'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'
					)
				)
			)
		)
	));
}