[*] WS : improved web service performances

This commit is contained in:
Damien Metzger
2013-07-02 17:46:11 +02:00
parent 6b71ec8b09
commit c60c3da6a1
2 changed files with 15 additions and 6 deletions
@@ -376,7 +376,7 @@ class WebserviceOutputBuilderCore
{
if ($key !== 'empty')
{
if ($this->fieldsToDisplay === 'minimum')
if ($this->fieldsToDisplay === 'minimum')
$output .= $this->renderEntityMinimum($object, $depth);
else
$output .= $this->renderEntity($object, $depth);
+14 -5
View File
@@ -530,9 +530,10 @@ class WebserviceRequestCore
}
}
}
return $this->returnOutput();
$return = $this->returnOutput();
unset($webservice_call);
unset ($display_errors);
unset($display_errors);
return $return;
}
protected function webserviceChecks()
@@ -1158,6 +1159,7 @@ class WebserviceRequestCore
$sorts = array($this->urlFragments['sort']);
$sql_sort .= ' ORDER BY ';
foreach ($sorts as $sort)
{
$delimiterPosition = strrpos($sort, '_');
@@ -1219,8 +1221,6 @@ class WebserviceRequestCore
return $filters;
}
public function getFilteredObjectList()
{
$objects = array();
@@ -1241,7 +1241,16 @@ class WebserviceRequestCore
if ($sqlObjects)
{
foreach ($sqlObjects as $sqlObject)
$objects[] = new $this->resourceConfiguration['retrieveData']['className']((int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']]);
{
if ($this->fieldsToDisplay == 'minimum')
{
$obj = new $this->resourceConfiguration['retrieveData']['className']();
$obj->id = (int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']];
$objects[] = $obj;
}
else
$objects[] = new $this->resourceConfiguration['retrieveData']['className']((int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']]);
}
return $objects;
}
}