+ /**
+ * Returns possible properties in the result, grouped by the value of the prop parameter
+ * that shows them.
+ *
+ * Properties that are shown always are in a group with empty string as a key.
+ * Properties that can be shown by several values of prop are included multiple times.
+ * If some properties are part of a list and some are on the root object (see ApiQueryQueryPage),
+ * those on the root object are under the key PROP_ROOT.
+ * The array can also contain a boolean under the key PROP_LIST,
+ * indicating whether the result is a list.
+ *
+ * Don't call this functon directly: use getFinalResultProperties() to
+ * allow hooks to modify descriptions as needed.
+ *
+ * @return array|bool False on no properties
+ */
+ protected function getResultProperties() {
+ return false;
+ }
+
+ /**
+ * Get final possible result properties, after hooks have had a chance to tweak it as
+ * needed.
+ *
+ * @return array
+ */
+ public function getFinalResultProperties() {
+ $properties = $this->getResultProperties();
+ wfRunHooks( 'APIGetResultProperties', array( $this, &$properties ) );
+ return $properties;
+ }
+
+ /**
+ * Add token properties to the array used by getResultProperties,
+ * based on a token functions mapping.
+ */
+ protected static function addTokenProperties( &$props, $tokenFunctions ) {
+ foreach ( array_keys( $tokenFunctions ) as $token ) {
+ $props[''][$token . 'token'] = array(
+ ApiBase::PROP_TYPE => 'string',
+ ApiBase::PROP_NULLABLE => true
+ );
+ }
+ }
+