[*] WS : Allow override of getter from different classes

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14208 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aKorczak
2012-03-15 17:44:34 +00:00
parent 92c3942325
commit 87e1d188ee
+12 -8
View File
@@ -579,21 +579,25 @@ class WebserviceOutputBuilderCore
'entity_name' => $ws_params['objectNodeName'],
'entities_name' => $ws_params['objectsNodeName'],
);
if (method_exists($object, $getter) && is_null($this->schemaToDisplay))
if (is_array($getter))
{
$association_resources = $object->$getter();
$association_resources = call_user_func($getter, $object);
if (is_array($association_resources) && !empty($association_resources))
{
foreach ($association_resources as $association_resource)
{
$objects_assoc[] = $association_resource;
}
}
}
else
{
$objects_assoc[] = '';
if (method_exists($object, $getter) && is_null($this->schemaToDisplay))
{
$association_resources = $object->$getter();
if (is_array($association_resources) && !empty($association_resources))
foreach ($association_resources as $association_resource)
$objects_assoc[] = $association_resource;
}
else
$objects_assoc[] = '';
}
$class_name = null;