Followup r84392
Be a bit more explicit about the code, add a bit of readability into foreach too
This commit is contained in:
parent
068522ccbe
commit
24d0b16dc9
1 changed files with 10 additions and 2 deletions
|
|
@ -251,11 +251,19 @@ abstract class ApiQueryBase extends ApiBase {
|
||||||
* @return ResultWrapper
|
* @return ResultWrapper
|
||||||
*/
|
*/
|
||||||
protected function select( $method, $extraQuery = array() ) {
|
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.
|
// Merge $this->tables with $extraQuery['tables'], $this->fields with $extraQuery['fields'], etc.
|
||||||
foreach ( array( 'tables', 'fields', 'where', 'options', 'join_conds' ) as $var ) {
|
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
|
// getDB has its own profileDBIn/Out calls
|
||||||
$db = $this->getDB();
|
$db = $this->getDB();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue