/** * Reads a backtrackoptions element and adds the content to the result object. * @param DOMNode $backTrackOptionsNode the node being inspected * @param GetSearchPageRecommendationResult $resultObj the result object to fill */ private function readBackTrackOptions(DOMNode $backTrackOptionsNode, GetSearchPageRecommendationResult $resultObj) { foreach ($backTrackOptionsNode->childNodes as $domainNode) { if ($domainNode->nodeName == "backtrackoption") { $option = new CancellableOption(); $option->setTextValue($domainNode->textContent); $groupFilteredName = ''; $groupMultiSelection = false; //read attributes foreach ($domainNode->attributes as $attribute) { switch ($attribute->name) { case "attname": $groupFilteredName = $attribute->value; break; case "searchRefiningOptions": $option->setSearchRefiningOption($attribute->value); break; case "discreteVal": $option->setDiscreteValue($attribute->value); break; case "minVal": $option->setRangeValueMin($attribute->value); break; case "maxVal": $option->setRangeValueMax($attribute->value); break; case "multiplevaluesselection": if ($attribute->value == "true") { $groupMultiSelection = true; } break; } } $group = NULL; if (!array_key_exists($groupFilteredName, $this->backTrackHashed)) { $group = new CancellableOptionGroup(); $group->setFilteredAttributeName($groupFilteredName); $group->setMultiSelect($groupMultiSelection); $resultObj->addCancellableFiltersGroup($group); $this->backTrackHashed[$groupFilteredName] = $group; } else { $group = $this->backTrackHashed[$groupFilteredName]; } $group->addFilteringOption($option); } } }