Mark ApiQueryBase methods accepting arrays
authorErik Bernhardson <ebernhardson@wikimedia.org>
Tue, 14 Feb 2017 23:41:19 +0000 (15:41 -0800)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Tue, 14 Feb 2017 23:42:57 +0000 (15:42 -0800)
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

includes/api/ApiQueryBase.php

index 281fb61..2d21865 100644 (file)
@@ -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 ) ) {