Api4 - Use explicit adder functions rather than magicMethod
[civicrm-core.git] / Civi / Api4 / Generic / BasicGetFieldsAction.php
index 5c2b0ccb11f0110f142d8b852164b93ec9ff2098..6bf10788162736bc07fe131247ae679f67615198 100644 (file)
@@ -30,7 +30,6 @@ use Civi\Api4\Utils\ActionUtil;
  * @method $this setLoadOptions(bool $value)
  * @method bool getLoadOptions()
  * @method $this setAction(string $value)
- * @method $this addValue(string $value)
  * @method $this setValues(array $values)
  * @method array getValues()
  */
@@ -127,6 +126,17 @@ class BasicGetFieldsAction extends BasicGetAction {
     return $sub[$this->action] ?? $this->action;
   }
 
+  /**
+   * Add an item to the values array
+   * @param string $fieldName
+   * @param mixed $value
+   * @return $this
+   */
+  public function addValue(string $fieldName, $value) {
+    $this->values[$fieldName] = $value;
+    return $this;
+  }
+
   public function fields() {
     return [
       [