| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\SpecialPage\Hook; |
| 4 | |
| 5 | use MediaWiki\Html\FormOptions; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "ChangesListSpecialPageQuery" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface ChangesListSpecialPageQueryHook { |
| 15 | /** |
| 16 | * This hook is called when building an SQL query on pages inheriting from |
| 17 | * ChangesListSpecialPage (in core: RecentChanges, RecentChangesLinked and |
| 18 | * Watchlist). Do not use this to implement individual filters if they are |
| 19 | * compatible with the ChangesListFilter and ChangesListFilterGroup structure. |
| 20 | * Instead, use sub-classes of those classes in conjunction with the |
| 21 | * ChangesListSpecialPageStructuredFilters hook. This hook can be used to |
| 22 | * implement filters that do not implement that structure or custom behavior |
| 23 | * that is not an individual filter. |
| 24 | * |
| 25 | * @since 1.35 |
| 26 | * |
| 27 | * @param string $name Name of the special page, e.g. 'Watchlist' |
| 28 | * @param array &$tables Array of tables to be queried |
| 29 | * @param array &$fields Array of columns to select |
| 30 | * @param array &$conds Array of WHERE conditionals for query |
| 31 | * @param array &$query_options Array of options for the database request |
| 32 | * @param array &$join_conds Join conditions for the tables |
| 33 | * @param FormOptions $opts FormOptions for this request |
| 34 | * @return bool|void True or no return value to continue or false to abort |
| 35 | */ |
| 36 | public function onChangesListSpecialPageQuery( $name, &$tables, &$fields, |
| 37 | &$conds, &$query_options, &$join_conds, $opts |
| 38 | ); |
| 39 | } |