projects
/
civicrm-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63782ba
)
CRM_Utils_Array::extend()
author
Tim Otten
<totten@civicrm.org>
Thu, 23 Jul 2015 10:22:35 +0000
(
03:22
-0700)
committer
Tim Otten
<totten@civicrm.org>
Sat, 15 Aug 2015 10:25:57 +0000
(
03:25
-0700)
CRM/Utils/Array.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/Array.php
b/CRM/Utils/Array.php
index a2d16088d81e2757e3dc1a3eaccb97f8f0f520a3..9af358d6a895a872eb727bb0e11e908b0335dc20 100644
(file)
--- a/
CRM/Utils/Array.php
+++ b/
CRM/Utils/Array.php
@@
-904,4
+904,21
@@
class CRM_Utils_Array {
return $result;
}
+ /**
+ * Copy all properties of $other into $array (recursively).
+ *
+ * @param array|ArrayAccess $array
+ * @param array $other
+ */
+ public static function extend(&$array, $other) {
+ foreach ($other as $key => $value) {
+ if (is_array($value)) {
+ self::extend($array[$key], $value);
+ }
+ else {
+ $array[$key] = $value;
+ }
+ }
+ }
+
}