Author: sevein
Date: Sun Apr 29 22:30:21 2012
New Revision: 11556
Log:
Update ES helper to build i18n of nested objects
Modified:
branches/2.0/lib/helper/QubitHelper.php
Modified: branches/2.0/lib/helper/QubitHelper.php
==============================================================================
--- branches/2.0/lib/helper/QubitHelper.php Sun Apr 29 22:04:04 2012
(r11555)
+++ branches/2.0/lib/helper/QubitHelper.php Sun Apr 29 22:30:21 2012
(r11556)
@@ -158,7 +158,7 @@
return round(($val / pow(1024, $i)), 1).' '.$units[$i];
}
-function build_i18n_doc(Elastica_Result $hit)
+function build_i18n_doc(Elastica_Result $hit, array $objects = array())
{
$doc = $hit->getData();
@@ -169,5 +169,16 @@
unset($doc['i18n']);
+ if (0 < count($objects))
+ {
+ foreach ($objects as $item)
+ {
+ foreach ($doc[$item] as $i18n)
+ {
+ $doc[$item][$i18n['culture']] = $i18n;
+ }
+ }
+ }
+
return $doc;
}
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.