Commit e01ca7c5caec4e0fa7a48de0cc4f674619735fb2

Authored by Benjamin Renard
1 parent 41109aaa

Improve performance to retrieve data mining result

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
php/classes/TimeTableMgr.php
... ... @@ -452,10 +452,11 @@ class TimeTableMgr extends AmdaObjectMgr
452 452 $attributesToReturn['folderId'] = $folderId;
453 453  
454 454 if (!$onlyDescription) {
455   - $intNodes = $dom->getElementsByTagName('intervals');
  455 + $xpath = new DOMXPath($dom);
456 456  
457   - /** @var DOMElement $intNode */
458   - foreach ($intNodes as $intNode) {
  457 + $intervals = $xpath->query('//intervals');
  458 +
  459 + foreach ($intervals as $intNode) {
459 460 $startNodes = $intNode->getElementsByTagName('start');
460 461 if ($startNodes->length <= 0) {
461 462 return ['error' => 'Error detected in result file'];
... ...