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:
7d7a990
)
CRM_Utils_REST: better datastructure support, constant list for instance, CRM-16709
author
Aron Novak
<aron.novak@agenceinovae.com>
Wed, 17 Jun 2015 15:16:01 +0000
(11:16 -0400)
committer
Aron Novak
<aron.novak@agenceinovae.com>
Wed, 17 Jun 2015 15:18:34 +0000
(11:18 -0400)
CRM/Utils/REST.php
patch
|
blob
|
blame
|
history
diff --git
a/CRM/Utils/REST.php
b/CRM/Utils/REST.php
index e1424833fd53d131b48e92eb02f495f9e98fcc6b..ec0468f07c03bc51b592e62f144aa0c46c3607c0 100644
(file)
--- a/
CRM/Utils/REST.php
+++ b/
CRM/Utils/REST.php
@@
-165,8
+165,13
@@
class CRM_Utils_REST {
// check if this is a single element result (contact_get etc)
// or multi element
if ($hier) {
- foreach ($result['values'] as $n => $v) {
- $xml .= "<Result>\n" . CRM_Utils_Array::xml($v) . "</Result>\n";
+ foreach ($result['values'] as $k => $v) {
+ if (is_array($v)) {
+ $xml .= "<Result>\n" . CRM_Utils_Array::xml($v) . "</Result>\n";
+ }
+ elseif (!is_object($v)) {
+ $xml .= "<Result>\n<id>{$k}</id><value>{$v}</value></Result>\n";
+ }
}
}
else {