dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Add SPARQL client to core"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiQueryBase.php
diff --git
a/includes/api/ApiQueryBase.php
b/includes/api/ApiQueryBase.php
index
051d346
..
84169cb
100644
(file)
--- a/
includes/api/ApiQueryBase.php
+++ b/
includes/api/ApiQueryBase.php
@@
-1,9
+1,5
@@
<?php
/**
<?php
/**
- *
- *
- * Created on Sep 7, 2006
- *
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
@@
-119,7
+115,7
@@
abstract class ApiQueryBase extends ApiBase {
* See ApiQuery::getNamedDB() for more information
* @param string $name Name to assign to the database connection
* @param int $db One of the DB_* constants
* See ApiQuery::getNamedDB() for more information
* @param string $name Name to assign to the database connection
* @param int $db One of the DB_* constants
- * @param
array
$groups Query groups
+ * @param
string|string[]
$groups Query groups
* @return IDatabase
*/
public function selectNamedDB( $name, $db, $groups ) {
* @return IDatabase
*/
public function selectNamedDB( $name, $db, $groups ) {
@@
-259,12
+255,10
@@
abstract class ApiQueryBase extends ApiBase {
/**
* Equivalent to addWhere(array($field => $value))
* @param string $field Field name
/**
* Equivalent to addWhere(array($field => $value))
* @param string $field Field name
- * @param string|string[] $value Value; ignored if null or empty array
;
+ * @param string|string[] $value Value; ignored if null or empty array
*/
protected function addWhereFld( $field, $value ) {
*/
protected function addWhereFld( $field, $value ) {
- // Use count() to its full documented capabilities to simultaneously
- // test for null, empty array or empty countable object
- if ( count( $value ) ) {
+ if ( $value !== null && !( is_array( $value ) && !$value ) ) {
$this->where[$field] = $value;
}
}
$this->where[$field] = $value;
}
}
@@
-457,7
+451,7
@@
abstract class ApiQueryBase extends ApiBase {
'ipb_expiry',
'ipb_timestamp'
] );
'ipb_expiry',
'ipb_timestamp'
] );
- $commentQuery = CommentStore::
newKey( 'ipb_reason' )->getJoin(
);
+ $commentQuery = CommentStore::
getStore()->getJoin( 'ipb_reason'
);
$this->addTables( $commentQuery['tables'] );
$this->addFields( $commentQuery['fields'] );
$this->addJoinConds( $commentQuery['joins'] );
$this->addTables( $commentQuery['tables'] );
$this->addFields( $commentQuery['fields'] );
$this->addJoinConds( $commentQuery['joins'] );