43 private function addDeletedUserFilter() {
45 $utils = MediaWikiServices::getInstance()->getHideUserUtils();
47 $this->
addWhere( $utils->getExpression( $this->getDB() ) );
49 $this->
addFields( [
'hu_deleted' =>
'1=0' ] );
52 'hu_deleted' => $utils->getExpression(
55 HideUserUtils::HIDDEN_USERS
71 private function getBlockDetailsForRows( $rows ) {
73 foreach ( $rows as $row ) {
74 $ids[] = (int)$row->user_id;
79 $blocks = MediaWikiServices::getInstance()->getDatabaseBlockStore()
80 ->newListFromConds( [
'bt_user' => $ids ] );
82 foreach ( $blocks as $block ) {
83 $blocksByUser[$block->getTargetUserIdentity()->getId()][] = $block;
86 foreach ( $blocksByUser as $id => $userBlocks ) {
87 if ( count( $userBlocks ) > 1 ) {
88 $maybeCompositeBlock = CompositeBlock::createFromBlocks( ...$userBlocks );
90 $maybeCompositeBlock = $userBlocks[0];
92 $infoByUser[$id] = $this->getBlockDetails( $maybeCompositeBlock );
105 abstract protected function getDB();
118 abstract protected function addTables( $tables, $alias =
null );
addTables( $tables, $alias=null)
trait ApiQueryBlockInfoTrait