MediaWiki  master
MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook Interface Reference

Stable to implement. More...

Inheritance diagram for MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook:

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. More...

Detailed Description

Stable to implement.

Definition at line 11 of file ApiQueryBaseBeforeQueryHook.php.

Member Function Documentation

◆ onApiQueryBaseBeforeQuery()

MediaWiki\Api\Hook\ApiQueryBaseBeforeQueryHook::onApiQueryBaseBeforeQuery (   $module,

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.

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.
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: