MediaWiki master
MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\Api\ApiHookRunner.

Public Member Functions

 onApiQueryBaseBeforeQuery ( $module, &$tables, &$fields, &$conds, &$query_options, &$join_conds, &$hookData)
 This hook is called for (some) API query modules before a database query is made.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ApiQueryBaseBeforeQuery" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 14 of file ApiQueryBaseBeforeQueryHook.php.

Member Function Documentation

◆ onApiQueryBaseBeforeQuery()

MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook::onApiQueryBaseBeforeQuery ( $module,
& $tables,
& $fields,
& $conds,
& $query_options,
& $join_conds,
& $hookData )

This hook is called for (some) API query modules before a database query is made.

WARNING: It would be very easy to misuse this hook and break the module! Any joins added must join on a unique key of the target table unless you really know what you're doing. An API query module wanting to use this hook should see the ApiQueryBase::select() and ApiQueryBase::processRow() documentation.

Since
1.35
Parameters
ApiQueryBase$moduleModule in question
array&$tablesArray of tables to be queried
array&$fieldsArray of columns to select
array&$condsArray of WHERE conditionals for query
array&$query_optionsArray of options for the database request
array&$join_condsJoin conditions for the tables
array&$hookDataArray that will be passed to the ApiQueryBaseAfterQuery and ApiQueryBaseProcessRow hooks, intended for inter-hook communication.
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\Api\ApiHookRunner.


The documentation for this interface was generated from the following file: