From: Erik Bernhardson Date: Tue, 14 Feb 2017 23:41:19 +0000 (-0800) Subject: Mark ApiQueryBase methods accepting arrays X-Git-Tag: 1.31.0-rc.0~4085^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_modifier.php?a=commitdiff_plain;h=0f0b67047d0d3c3b7c662898527e1317cf9e17a9;p=lhc%2Fweb%2Fwiklou.git Mark ApiQueryBase methods accepting arrays These particular functions build up data to be passed into the database abstraction, which accepts not only strings but arrays. Where conditions generate `field IN ('a', 'b', 'c')` clauses. The options can be used with, for example, sort to sort by one field and then a second. Change-Id: I743f14f0e56c7f0546dfecd130925e15d63c7d64 --- diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 281fb61eb7..2d218652e9 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -258,7 +258,7 @@ abstract class ApiQueryBase extends ApiBase { /** * Equivalent to addWhere(array($field => $value)) * @param string $field Field name - * @param 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 ) { // Use count() to its full documented capabilities to simultaneously @@ -325,7 +325,7 @@ abstract class ApiQueryBase extends ApiBase { * Add an option such as LIMIT or USE INDEX. If an option was set * before, the old value will be overwritten * @param string $name Option name - * @param string $value Option value + * @param string|string[] $value Option value */ protected function addOption( $name, $value = null ) { if ( is_null( $value ) ) {