| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use Wikimedia\Rdbms\IReadableDatabase; |
| 6 | |
| 7 | /** |
| 8 | * This is a hook handler interface, see docs/Hooks.md. |
| 9 | * Use the hook name "UsersPagerDoBatchLookups" to register handlers implementing this interface. |
| 10 | * |
| 11 | * @stable to implement |
| 12 | * @ingroup Hooks |
| 13 | */ |
| 14 | interface UsersPagerDoBatchLookupsHook { |
| 15 | /** |
| 16 | * This hook is called in UsersPager::doBatchLookups() |
| 17 | * |
| 18 | * It is used to give extensions providing user group data from an alternate source a |
| 19 | * chance to add their data into the cache array so that things like global user groups are |
| 20 | * displayed correctly in Special:ListUsers. |
| 21 | * |
| 22 | * @since 1.35 |
| 23 | * |
| 24 | * @param IReadableDatabase $dbr Read-only database handle |
| 25 | * @param int[] $userIds Array of user IDs whose groups we should look up |
| 26 | * @param array &$cache Array of user ID -> (array of internal group name (e.g. 'sysop') -> |
| 27 | * UserGroupMembership object) |
| 28 | * @param array &$groups Array of group name -> bool true mappings for members of a given user |
| 29 | * group |
| 30 | * @return bool|void True or no return value to continue or false to abort |
| 31 | */ |
| 32 | public function onUsersPagerDoBatchLookups( $dbr, $userIds, &$cache, &$groups ); |
| 33 | } |