From ec2eca5ae29a2bd055c22d9af013b7aa8baf613e Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 1 Mar 2018 17:46:45 -0800 Subject: [PATCH] CRM_Util_SQL_Select::merge() - Accept an array of multiple fragments --- CRM/Utils/SQL/Select.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/SQL/Select.php b/CRM/Utils/SQL/Select.php index 23adc513d4..eb40b59074 100644 --- a/CRM/Utils/SQL/Select.php +++ b/CRM/Utils/SQL/Select.php @@ -177,7 +177,7 @@ class CRM_Utils_SQL_Select implements ArrayAccess { /** * Merge something or other. * - * @param CRM_Utils_SQL_Select $other + * @param array|CRM_Utils_SQL_Select $other * @param array|NULL $parts * ex: 'joins', 'wheres' * @return CRM_Utils_SQL_Select @@ -187,6 +187,13 @@ class CRM_Utils_SQL_Select implements ArrayAccess { return $this; } + if (is_array($other)) { + foreach ($other as $fragment) { + $this->merge($fragment, $parts); + } + return $this; + } + if ($this->mode === self::INTERPOLATE_AUTO) { $this->mode = $other->mode; } -- 2.25.1