From: Sam Reed Date: Sun, 20 Mar 2011 22:35:41 +0000 (+0000) Subject: Followup r84392 X-Git-Tag: 1.31.0-rc.0~31280 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=24d0b16dc9010e10d2bc54ab65d77bde5b478abf;p=lhc%2Fweb%2Fwiklou.git Followup r84392 Be a bit more explicit about the code, add a bit of readability into foreach too --- diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 3fca7827ab..4fd1276530 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -251,11 +251,19 @@ abstract class ApiQueryBase extends ApiBase { * @return ResultWrapper */ protected function select( $method, $extraQuery = array() ) { + $tables = $this->tables; + $fields = $this->fields; + $where = $this->where; + $options = $this->options; + $join_conds = $this->join_conds; + // Merge $this->tables with $extraQuery['tables'], $this->fields with $extraQuery['fields'], etc. foreach ( array( 'tables', 'fields', 'where', 'options', 'join_conds' ) as $var ) { - $$var = array_merge( $this->{$var}, isset( $extraQuery[$var] ) ? (array)$extraQuery[$var] : array() ); + if ( isset( $extraQuery[$var] ) ) { + $$var = array_merge( $$var, (array)$extraQuery[$var] ); + } } - + // getDB has its own profileDBIn/Out calls $db = $this->getDB();