|
MediaWiki master
|
This class represents the result of the API operations. More...
Inherits MediaWiki\Api\ApiSerializable.

Public Member Functions | |
| __construct ( $maxSize) | |
| serializeForApiResult () | |
| Allow for adding one ApiResult into another. | |
| setErrorFormatter (ApiErrorFormatter $formatter) | |
Public Attributes | |
| const | ADD_ON_TOP = 2 |
| For addValue(), setValue() and similar functions, if the value does not exist, add it as the first element. | |
| const | IGNORE_CONFLICT_KEYS = 16 |
| For addValue(), setValue() and similar functions, do allow override of conflicting keys. | |
| const | META_BC_BOOLS = '_BC_bools' |
| Key for the 'BC bools' metadata item. | |
| const | META_BC_SUBELEMENTS = '_BC_subelements' |
| Key for the 'BC subelements' metadata item. | |
| const | META_CONTENT = '_content' |
| Key for the 'content' metadata item. | |
| const | META_INDEXED_TAG_NAME = '_element' |
| Key for the 'indexed tag name' metadata item. | |
| const | META_KVP_KEY_NAME = '_kvpkeyname' |
| Key for the metadata item whose value specifies the name used for the kvp key in the alternative output format with META_TYPE 'kvp' or 'BCkvp', i.e. | |
| const | META_KVP_MERGE = '_kvpmerge' |
| Key for the metadata item that indicates that the KVP key should be added into an assoc value, i.e. | |
| const | META_PRESERVE_KEYS = '_preservekeys' |
| Key for the 'preserve keys' metadata item. | |
| const | META_SUBELEMENTS = '_subelements' |
| Key for the 'subelements' metadata item. | |
| const | META_TYPE = '_type' |
| Key for the 'type' metadata item. | |
| const | NO_SIZE_CHECK = 4 |
| For addValue() and similar functions, do not check size while adding a value Don't use this unless you REALLY know what you're doing. | |
| const | NO_VALIDATE = self::NO_SIZE_CHECK | 8 |
| For addValue(), setValue() and similar functions, do not validate data. | |
| const | OVERRIDE = 1 |
| Override existing value in addValue(), setValue(), and similar functions. | |
Content | |
| reset () | |
| Clear the current result data. | |
| getResultData ( $path=[], $transforms=[]) | |
| Get the result data array. | |
| getSize () | |
| Get the size of the result, i.e. | |
| addValue ( $path, $name, $value, $flags=0) | |
| Add value to the output data at the given path. | |
| removeValue ( $path, $name, $flags=0) | |
| Remove value from the output data at the given path. | |
| addContentValue ( $path, $name, $value, $flags=0) | |
| Add value to the output data at the given path and mark as META_CONTENT. | |
| addParsedLimit ( $moduleName, $limit) | |
| Add the numeric limit for a limit=max to the result. | |
| static | setValue (array &$arr, $name, $value, $flags=0) |
| Add an output value to the array by name. | |
| static | unsetValue (array &$arr, $name) |
| Remove an output value to the array by name. | |
| static | setContentValue (array &$arr, $name, $value, $flags=0) |
| Add an output value to the array by name and mark as META_CONTENT. | |
Metadata | |
| addContentField ( $path, $name, $flags=0) | |
| Set the name of the content field name (META_CONTENT). | |
| addSubelementsList ( $path, $names) | |
| Causes the elements with the specified names to be output as subelements rather than attributes. | |
| removeSubelementsList ( $path, $names) | |
| Causes the elements with the specified names to be output as attributes (when possible) rather than as subelements. | |
| addIndexedTagName ( $path, $tag) | |
| Set the tag name for numeric-keyed values in XML format. | |
| addIndexedTagNameRecursive ( $path, $tag) | |
| Set indexed tag name on $path and all subarrays. | |
| addPreserveKeysList ( $path, $names) | |
| Preserve specified keys. | |
| removePreserveKeysList ( $path, $names) | |
| Don't preserve specified keys. | |
| addArrayType ( $path, $tag, $kvpKeyName=null) | |
| Set the array data type for a path. | |
| addArrayTypeRecursive ( $path, $tag, $kvpKeyName=null) | |
| Set the array data type for a path recursively. | |
| static | setContentField (array &$arr, $name, $flags=0) |
| Set the name of the content field name (META_CONTENT). | |
| static | setSubelementsList (array &$arr, $names) |
| Causes the elements with the specified names to be output as subelements rather than attributes. | |
| static | unsetSubelementsList (array &$arr, $names) |
| Causes the elements with the specified names to be output as attributes (when possible) rather than as subelements. | |
| static | setIndexedTagName (array &$arr, $tag) |
| Set the tag name for numeric-keyed values in XML format. | |
| static | setIndexedTagNameRecursive (array &$arr, $tag) |
| Set indexed tag name on $arr and all subarrays. | |
| static | setPreserveKeysList (array &$arr, $names) |
| Preserve specified keys. | |
| static | unsetPreserveKeysList (array &$arr, $names) |
| Don't preserve specified keys. | |
| static | setArrayType (array &$arr, $type, $kvpKeyName=null) |
| Set the array data type. | |
| static | setArrayTypeRecursive (array &$arr, $type, $kvpKeyName=null) |
| Set the array data type recursively. | |
Utility | |
| static | isMetadataKey ( $key) |
| Test whether a key should be considered metadata. | |
| static | stripMetadata ( $data) |
| Recursively remove metadata keys from a data array or object. | |
| static | stripMetadataNonRecursive ( $data, &$metadata=null) |
| Remove metadata keys from a data array or object, non-recursive. | |
| static | addMetadataToResultVars ( $vars, $forceHash=true) |
| Add the correct metadata to an array of vars we want to export through the API. | |
| static | formatExpiry ( $expiry, $infinity='infinity') |
| Format an expiry timestamp for API output. | |
| static | applyTransformations (array $dataIn, array $transforms) |
| Apply transformations to an array, returning the transformed array. | |
This class represents the result of the API operations.
It simply wraps a nested array structure, adding some functions to simplify array's modifications. As various modules execute, they add different pieces of information to this result, structuring it as it will be given to the client.
Each subarray may either be a dictionary - key-value pairs with unique keys, or lists, where the items are added using $data[] = $value notation.
Definition at line 34 of file ApiResult.php.
| MediaWiki\Api\ApiResult::__construct | ( | $maxSize | ) |
| int | false | $maxSize | Maximum result "size", or false for no limit |
Definition at line 161 of file ApiResult.php.
References reset().
| MediaWiki\Api\ApiResult::addArrayType | ( | $path, | |
| $tag, | |||
| $kvpKeyName = null ) |
Set the array data type for a path.
| array | string | null | $path | See ApiResult::addValue() |
| string | $tag | See ApiResult::META_TYPE |
| string | null | $kvpKeyName | See ApiResult::META_KVP_KEY_NAME |
Definition at line 752 of file ApiResult.php.
References $path, and setArrayType().
| MediaWiki\Api\ApiResult::addArrayTypeRecursive | ( | $path, | |
| $tag, | |||
| $kvpKeyName = null ) |
Set the array data type for a path recursively.
| array | string | null | $path | See ApiResult::addValue() |
| string | $tag | See ApiResult::META_TYPE |
| string | null | $kvpKeyName | See ApiResult::META_KVP_KEY_NAME |
Definition at line 780 of file ApiResult.php.
References $path, and setArrayTypeRecursive().
| MediaWiki\Api\ApiResult::addContentField | ( | $path, | |
| $name, | |||
| $flags = 0 ) |
Set the name of the content field name (META_CONTENT).
| array | string | null | $path | See ApiResult::addValue() |
| string | int | $name | Name of the field |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. |
Definition at line 558 of file ApiResult.php.
References $path, and setContentField().
Referenced by addContentValue().
| MediaWiki\Api\ApiResult::addContentValue | ( | $path, | |
| $name, | |||
| $value, | |||
| $flags = 0 ) |
Add value to the output data at the given path and mark as META_CONTENT.
| array | string | null | $path | See ApiResult::addValue() |
| string | int | $name | See ApiResult::setValue() |
| mixed | $value | |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. |
Definition at line 502 of file ApiResult.php.
References $path, addContentField(), and addValue().
| MediaWiki\Api\ApiResult::addIndexedTagName | ( | $path, | |
| $tag ) |
Set the tag name for numeric-keyed values in XML format.
| array | string | null | $path | See ApiResult::addValue() |
| string | $tag | Tag name |
Definition at line 634 of file ApiResult.php.
References $path, and setIndexedTagName().
| MediaWiki\Api\ApiResult::addIndexedTagNameRecursive | ( | $path, | |
| $tag ) |
Set indexed tag name on $path and all subarrays.
| array | string | null | $path | See ApiResult::addValue() |
| string | $tag | Tag name |
Definition at line 665 of file ApiResult.php.
References $path, and setIndexedTagNameRecursive().
|
static |
Add the correct metadata to an array of vars we want to export through the API.
| array | $vars | |
| bool | $forceHash |
Definition at line 1174 of file ApiResult.php.
References addMetadataToResultVars().
Referenced by addMetadataToResultVars(), MediaWiki\Api\ApiExpandTemplates\execute(), and MediaWiki\Api\ApiParse\execute().
| MediaWiki\Api\ApiResult::addParsedLimit | ( | $moduleName, | |
| $limit ) |
Add the numeric limit for a limit=max to the result.
| string | $moduleName | |
| int | $limit |
Definition at line 517 of file ApiResult.php.
References addValue().
| MediaWiki\Api\ApiResult::addPreserveKeysList | ( | $path, | |
| $names ) |
Preserve specified keys.
| array | string | null | $path | See ApiResult::addValue() |
| array | string | $names | The element name(s) to preserve |
Definition at line 695 of file ApiResult.php.
References $path, and setPreserveKeysList().
| MediaWiki\Api\ApiResult::addSubelementsList | ( | $path, | |
| $names ) |
Causes the elements with the specified names to be output as subelements rather than attributes.
| array | string | null | $path | See ApiResult::addValue() |
| array | string | int | $names | The element name(s) to be output as subelements |
Definition at line 585 of file ApiResult.php.
References $path, and setSubelementsList().
| MediaWiki\Api\ApiResult::addValue | ( | $path, | |
| $name, | |||
| $value, | |||
| $flags = 0 ) |
Add value to the output data at the given path.
Path can be an indexed array, each element specifying the branch at which to add the new value. Setting $path to [ 'a', 'b', 'c' ] is equivalent to data['a']['b']['c'] = $value. If $path is null, the value will be inserted at the data root.
| array | string | int | null | $path | |
| string | int | null | $name | See ApiResult::setValue() |
| mixed | $value | |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This parameter used to be boolean, and the value of OVERRIDE=1 was specifically chosen so that it would be backwards compatible with the new method signature. |
Definition at line 411 of file ApiResult.php.
References $path, MediaWiki\Message\Message\numParam(), and setValue().
Referenced by addContentValue(), addParsedLimit(), MediaWiki\Debug\MWDebug\appendDebugInfoToApiResult(), MediaWiki\Api\ApiPageSet\populateGeneratorData(), and MediaWiki\Api\ApiContinuationManager\setContinuationIntoResult().
|
staticprotected |
Apply transformations to an array, returning the transformed array.
| array | $dataIn | |
| array | $transforms |
Definition at line 810 of file ApiResult.php.
References applyTransformations(), setPreserveKeysList(), and stripMetadataNonRecursive().
Referenced by applyTransformations(), and getResultData().
|
static |
Format an expiry timestamp for API output.
| string | null | false | $expiry | Expiry timestamp, likely from the database |
| string | $infinity | Use this string for infinite expiry (only use this to maintain backward compatibility with existing output) |
Definition at line 1229 of file ApiResult.php.
References MediaWiki\MediaWikiServices\getInstance(), wfIsInfinity(), and wfTimestamp().
Referenced by MediaWiki\Api\ApiBlock\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiBlockInfoHelper\getBlockDetails(), and MediaWiki\Api\getWatchlistExpiry().
| MediaWiki\Api\ApiResult::getResultData | ( | $path = [], | |
| $transforms = [] ) |
Get the result data array.
The returned value should be considered read-only.
Transformations include:
Custom: (callable) Applied before other transformations. Signature is function ( &$data, &$metadata ), return value is ignored. Called for each nested array.
BC: (array) This transformation does various adjustments to bring the output in line with the pre-1.25 result format. The value array is a list of flags: 'nobool', 'no*', 'nosub'.
Types: (assoc) Apply transformations based on META_TYPE. The values array is an associative array with the following possible keys:
Strip: (string) Strips metadata keys from the result.
| array | string | null | $path | Path to fetch, see ApiResult::addValue |
| array | $transforms | See above |
Definition at line 250 of file ApiResult.php.
References $path, and applyTransformations().
| MediaWiki\Api\ApiResult::getSize | ( | ) |
Get the size of the result, i.e.
the amount of bytes in it
Definition at line 271 of file ApiResult.php.
|
static |
Test whether a key should be considered metadata.
| string | int | $key |
Definition at line 797 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiFeedWatchlist\execute(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| MediaWiki\Api\ApiResult::removePreserveKeysList | ( | $path, | |
| $names ) |
Don't preserve specified keys.
| array | string | null | $path | See ApiResult::addValue() |
| array | string | $names | The element name(s) to not preserve |
Definition at line 720 of file ApiResult.php.
References $path, and unsetPreserveKeysList().
| MediaWiki\Api\ApiResult::removeSubelementsList | ( | $path, | |
| $names ) |
Causes the elements with the specified names to be output as attributes (when possible) rather than as subelements.
| array | string | null | $path | See ApiResult::addValue() |
| array | string | int | $names | The element name(s) to not be output as subelements |
Definition at line 610 of file ApiResult.php.
References $path, and unsetSubelementsList().
| MediaWiki\Api\ApiResult::removeValue | ( | $path, | |
| $name, | |||
| $flags = 0 ) |
Remove value from the output data at the given path.
| array | string | null | $path | See ApiResult::addValue() |
| string | int | null | $name | Index to remove at $path. If null, $path itself is removed. |
| int | $flags | Flags used when adding the value |
Definition at line 459 of file ApiResult.php.
References $path, and unsetValue().
| MediaWiki\Api\ApiResult::reset | ( | ) |
Clear the current result data.
Definition at line 190 of file ApiResult.php.
Referenced by __construct().
| MediaWiki\Api\ApiResult::serializeForApiResult | ( | ) |
Allow for adding one ApiResult into another.
Implements MediaWiki\Api\ApiSerializable.
Definition at line 179 of file ApiResult.php.
|
static |
Set the array data type.
| array | &$arr | |
| string | $type | See ApiResult::META_TYPE |
| string | null | $kvpKeyName | See ApiResult::META_KVP_KEY_NAME |
Definition at line 733 of file ApiResult.php.
Referenced by addArrayType(), MediaWiki\Api\ApiQuerySiteinfo\appendDoubleUnderscores(), MediaWiki\Api\ApiQuerySiteinfo\appendExtensionTags(), MediaWiki\Api\ApiQuerySiteinfo\appendFunctionHooks(), MediaWiki\Api\ApiQuerySiteinfo\appendProtocols(), MediaWiki\Api\ApiQuerySiteinfo\appendRestrictions(), MediaWiki\Api\ApiQuerySiteinfo\appendSubscribedHooks(), MediaWiki\Api\ApiQuerySiteinfo\appendVariables(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiParse\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryFileRepoInfo\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiQueryUserInfo\getCentralUserInfo(), and setArrayTypeRecursive().
|
static |
Set the array data type recursively.
| array | &$arr | |
| string | $type | See ApiResult::META_TYPE |
| string | null | $kvpKeyName | See ApiResult::META_KVP_KEY_NAME |
Definition at line 764 of file ApiResult.php.
References setArrayType(), and setArrayTypeRecursive().
Referenced by addArrayTypeRecursive(), MediaWiki\Api\ApiQueryFileRepoInfo\execute(), and setArrayTypeRecursive().
|
static |
Set the name of the content field name (META_CONTENT).
| array | &$arr | |
| string | int | $name | Name of the field |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. |
Definition at line 537 of file ApiResult.php.
Referenced by addContentField(), and setContentValue().
|
static |
Add an output value to the array by name and mark as META_CONTENT.
| array | &$arr | To add $value to |
| string | int | $name | Index of $arr to add $value at. |
| mixed | $value | |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. |
Definition at line 484 of file ApiResult.php.
References setContentField(), and setValue().
Referenced by MediaWiki\Api\ApiQuerySiteinfo\appendLanguages(), MediaWiki\Api\ApiQuerySiteinfo\appendNamespaceAliases(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiQueryAllMessages\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryExternalLinks\execute(), MediaWiki\Api\ApiQueryIWLinks\execute(), MediaWiki\Api\ApiQueryLangLinks\execute(), MediaWiki\Api\ApiQueryCategoryList\executeQuery(), and MediaWiki\Api\ApiRsd\formatRsdApiList().
| MediaWiki\Api\ApiResult::setErrorFormatter | ( | ApiErrorFormatter | $formatter | ) |
|
static |
Set the tag name for numeric-keyed values in XML format.
| array | &$arr | |
| string | $tag | Tag name |
Definition at line 621 of file ApiResult.php.
Referenced by addIndexedTagName(), MediaWiki\Api\ApiQueryBase\addPageSubItems(), MediaWiki\Debug\MWDebug\appendDebugInfoToApiResult(), MediaWiki\Api\ApiQuerySiteinfo\appendDoubleUnderscores(), MediaWiki\Api\ApiQuerySiteinfo\appendExtensionTags(), MediaWiki\Api\ApiQuerySiteinfo\appendFunctionHooks(), MediaWiki\Api\ApiQuerySiteinfo\appendMagicWords(), MediaWiki\Api\ApiQuerySiteinfo\appendProtocols(), MediaWiki\Api\ApiQuerySiteinfo\appendRestrictions(), MediaWiki\Api\ApiQuerySiteinfo\appendSpecialPageAliases(), MediaWiki\Api\ApiQuerySiteinfo\appendSubscribedHooks(), MediaWiki\Api\ApiQuerySiteinfo\appendVariables(), MediaWiki\Api\ApiErrorFormatter_BackCompat\arrayFromStatus(), MediaWiki\Api\ApiEditPage\execute(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiImageRotate\execute(), MediaWiki\Api\ApiImport\execute(), MediaWiki\Api\ApiMove\execute(), MediaWiki\Api\ApiParamInfo\execute(), MediaWiki\Api\ApiProtect\execute(), MediaWiki\Api\ApiPurge\execute(), MediaWiki\Api\ApiQueryAllUsers\execute(), MediaWiki\Api\ApiQueryDeletedrevs\execute(), MediaWiki\Api\ApiQueryFileRepoInfo\execute(), MediaWiki\Api\ApiQueryLanguageinfo\execute(), MediaWiki\Api\ApiQueryUsers\execute(), MediaWiki\Api\ApiRevisionDelete\execute(), MediaWiki\Api\ApiRsd\execute(), MediaWiki\Api\ApiSetNotificationTimestamp\execute(), MediaWiki\Api\ApiTag\execute(), MediaWiki\Api\ApiUserrights\execute(), MediaWiki\Api\ApiWatch\execute(), MediaWiki\Api\ApiQueryRevisionsBase\extractRevisionInfo(), MediaWiki\Api\ApiQueryRecentChanges\extractRowInfo(), MediaWiki\Api\ApiParamInfo\formatHelpMessages(), MediaWiki\Api\ApiRsd\formatRsdApiList(), MediaWiki\Api\ApiPageSet\getConvertedTitlesAsResult(), MediaWiki\Api\ApiPageSet\getInterwikiTitlesAsResult(), MediaWiki\Api\ApiPageSet\getMissingRevisionIDsAsResult(), MediaWiki\Api\ApiPageSet\getNormalizedTitlesAsResult(), MediaWiki\Api\ApiPageSet\getRedirectTitlesAsResult(), MediaWiki\Api\ApiQueryImageInfo\processMetaData(), MediaWiki\Api\ApiQueryAllDeletedRevisions\run(), MediaWiki\Api\ApiQueryAllRevisions\run(), and MediaWiki\Api\ApiUpload\transformWarnings().
|
static |
Set indexed tag name on $arr and all subarrays.
| array | &$arr | |
| string | $tag | Tag name |
Definition at line 646 of file ApiResult.php.
References setIndexedTagNameRecursive().
Referenced by addIndexedTagNameRecursive(), and setIndexedTagNameRecursive().
|
static |
Preserve specified keys.
This prevents XML name mangling and preventing keys from being removed by self::stripMetadata().
| array | &$arr | |
| array | string | $names | The element name(s) to preserve |
Definition at line 680 of file ApiResult.php.
Referenced by addPreserveKeysList(), and applyTransformations().
|
static |
Causes the elements with the specified names to be output as subelements rather than attributes.
| array | &$arr | |
| array | string | int | $names | The element name(s) to be output as subelements |
Definition at line 570 of file ApiResult.php.
Referenced by addSubelementsList(), MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiRsd\execute(), and MediaWiki\Api\ApiRsd\formatRsdApiList().
|
static |
Add an output value to the array by name.
Verifies that value with the same name has not been added before.
| array | &$arr | To add $value to |
| string | int | null | $name | Index of $arr to add $value at, or null to use the next numeric index. |
| mixed | $value | |
| int | $flags | Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. |
Definition at line 287 of file ApiResult.php.
Referenced by addValue(), and setContentValue().
|
static |
Recursively remove metadata keys from a data array or object.
Note this removes all potential metadata keys, not just the defined ones.
| array | stdClass | $data |
Definition at line 1046 of file ApiResult.php.
References stripMetadata().
Referenced by stripMetadata().
|
static |
Remove metadata keys from a data array or object, non-recursive.
Note this removes all potential metadata keys, not just the defined ones.
| array | stdClass | $data | |
| array | null | &$metadata | Store metadata here, if provided |
Definition at line 1080 of file ApiResult.php.
Referenced by applyTransformations().
|
static |
Don't preserve specified keys.
| array | &$arr | |
| array | string | $names | The element name(s) to not preserve |
Definition at line 707 of file ApiResult.php.
Referenced by removePreserveKeysList().
|
static |
Causes the elements with the specified names to be output as attributes (when possible) rather than as subelements.
| array | &$arr | |
| array | string | int | $names | The element name(s) to not be output as subelements |
Definition at line 597 of file ApiResult.php.
Referenced by removeSubelementsList().
|
static |
Remove an output value to the array by name.
| array | &$arr | To remove $value from |
| string | int | $name | Index of $arr to remove |
Definition at line 440 of file ApiResult.php.
Referenced by removeValue().
| const MediaWiki\Api\ApiResult::ADD_ON_TOP = 2 |
For addValue(), setValue() and similar functions, if the value does not exist, add it as the first element.
In case the new value has no name (numerical index), all indexes will be renumbered.
Definition at line 48 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiErrorFormatter\addWarningOrError(), MediaWiki\Api\ApiErrorFormatter_BackCompat\addWarningOrError(), MediaWiki\Api\ApiQuery\execute(), and MediaWiki\Api\ApiContinuationManager\setContinuationIntoResult().
| const MediaWiki\Api\ApiResult::IGNORE_CONFLICT_KEYS = 16 |
For addValue(), setValue() and similar functions, do allow override of conflicting keys.
Definition at line 72 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiQueryImageInfo\execute().
| const MediaWiki\Api\ApiResult::META_BC_BOOLS = '_BC_bools' |
Key for the 'BC bools' metadata item.
Value is string[]. Note no setter is provided.
Definition at line 142 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiQuerySiteinfo\appendDefaultOptions(), MediaWiki\Api\ApiQueryImageInfo\processMetaData(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_BC_SUBELEMENTS = '_BC_subelements' |
Key for the 'BC subelements' metadata item.
Value is string[]. Note no setter is provided.
Definition at line 149 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiParse\execute(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_CONTENT = '_content' |
Key for the 'content' metadata item.
Value is string.
Definition at line 96 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiErrorFormatter\formatMessageInternal(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_INDEXED_TAG_NAME = '_element' |
Key for the 'indexed tag name' metadata item.
Value is string.
Definition at line 78 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_KVP_KEY_NAME = '_kvpkeyname' |
Key for the metadata item whose value specifies the name used for the kvp key in the alternative output format with META_TYPE 'kvp' or 'BCkvp', i.e.
the "name" in <container>value</container>. Value is string.
Definition at line 125 of file ApiResult.php.
| const MediaWiki\Api\ApiResult::META_KVP_MERGE = '_kvpmerge' |
Key for the metadata item that indicates that the KVP key should be added into an assoc value, i.e.
{"key":{"val1":"a","val2":"b"}} transforms to {"name":"key","val1":"a","val2":"b"} rather than {"name":"key","value":{"val1":"a","val2":"b"}}. Value is boolean.
Definition at line 135 of file ApiResult.php.
| const MediaWiki\Api\ApiResult::META_PRESERVE_KEYS = '_preservekeys' |
Key for the 'preserve keys' metadata item.
Value is string[].
Definition at line 90 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_SUBELEMENTS = '_subelements' |
Key for the 'subelements' metadata item.
Value is string[].
Definition at line 84 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiExpandTemplates\execute(), MediaWiki\Api\ApiParse\execute(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::META_TYPE = '_type' |
Key for the 'type' metadata item.
Value is one of the following strings:
</container> rather than <container key="value" >
Definition at line 116 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiQuerySiteinfo\appendNamespaces(), MediaWiki\Api\ApiFormatXml\execute(), MediaWiki\Api\ApiQueryBlocks\execute(), MediaWiki\Api\ApiErrorFormatter\formatMessageInternal(), MediaWiki\Api\ApiAuthManagerHelper\formatRequests(), MediaWiki\Api\ApiQueryImageInfo\getInfo(), MediaWiki\Api\ApiQueryUserInfo\getRateLimits(), and MediaWiki\Api\ApiFormatXml\recXmlPrint().
| const MediaWiki\Api\ApiResult::NO_SIZE_CHECK = 4 |
For addValue() and similar functions, do not check size while adding a value Don't use this unless you REALLY know what you're doing.
Values added while the size checking was disabled will never be counted. Ignored for setValue() and similar functions.
Definition at line 57 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiMain\addRequestedFields(), MediaWiki\Api\ApiErrorFormatter\addWarningOrError(), MediaWiki\Api\ApiErrorFormatter_BackCompat\addWarningOrError(), MediaWiki\Api\ApiComparePages\execute(), MediaWiki\Api\ApiFormatXml\execute(), MediaWiki\Api\ApiHelp\execute(), MediaWiki\Api\ApiQuery\execute(), MediaWiki\Api\ApiContinuationManager\setContinuationIntoResult(), and MediaWiki\Api\ApiMain\substituteResultWithError().
| const MediaWiki\Api\ApiResult::NO_VALIDATE = self::NO_SIZE_CHECK | 8 |
For addValue(), setValue() and similar functions, do not validate data.
Also disables size checking. If you think you need to use this, you're probably wrong.
Definition at line 65 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiFormatFeedWrapper\setResult().
| const MediaWiki\Api\ApiResult::OVERRIDE = 1 |
Override existing value in addValue(), setValue(), and similar functions.
Definition at line 40 of file ApiResult.php.
Referenced by MediaWiki\Api\ApiErrorFormatter_BackCompat\addWarningOrError(), and MediaWiki\Api\ApiPageSet\populateGeneratorData().