Merge "Add SPARQL client to core"
[lhc/web/wiklou.git] / includes / api / ApiQueryBlocks.php
index 698c13c..10695b3 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- *
- *
- * Created on Sep 10, 2007
- *
  * Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
@@ -37,7 +33,7 @@ class ApiQueryBlocks extends ApiQueryBase {
 
        public function execute() {
                $db = $this->getDB();
-               $commentStore = new CommentStore( 'ipb_reason' );
+               $commentStore = CommentStore::getStore();
                $params = $this->extractRequestParams();
                $this->requireMaxOneParameter( $params, 'users', 'ip' );
 
@@ -68,7 +64,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                        $fld_flags );
 
                if ( $fld_reason ) {
-                       $commentQuery = $commentStore->getJoin();
+                       $commentQuery = $commentStore->getJoin( 'ipb_reason' );
                        $this->addTables( $commentQuery['tables'] );
                        $this->addFields( $commentQuery['fields'] );
                        $this->addJoinConds( $commentQuery['joins'] );
@@ -212,7 +208,7 @@ class ApiQueryBlocks extends ApiQueryBase {
                                $block['expiry'] = ApiResult::formatExpiry( $row->ipb_expiry );
                        }
                        if ( $fld_reason ) {
-                               $block['reason'] = $commentStore->getComment( $row )->text;
+                               $block['reason'] = $commentStore->getComment( 'ipb_reason', $row )->text;
                        }
                        if ( $fld_range && !$row->ipb_auto ) {
                                $block['rangestart'] = IP::formatHex( $row->ipb_range_start );