if ($selectedCategoryChoice == 'Category') { $filterCategory = null; } else { $filterCategory = $selectedCategoryChoice; } if ($selectedBrandChoice == 'Brand') { $filterBrand = null; } else { $filterBrand = array($selectedBrandChoice); } if ($selectedEfficiencyClassChoice == 'Efficiency Class') { $filterEfficiencyClass = null; } else { $filterEfficiencyClass = array($selectedEfficiencyClassChoice); } $itemsFiltered = $controller->getDevicesByFilter($filterCategory, $filterBrand, $filterEfficiencyClass); $currentItemsArray = $itemsFiltered; } else { if (empty($searchBarContent)) { $itemsFiltered = $controller->getAllDevices(); // otherwise display all objects $currentItemsArray = $itemsFiltered; } else { $itemsFiltered = $controller->getDevicesByModel($searchBarContent); $currentItemsArray = $itemsFiltered; $selectedCategoryChoice = $itemsFiltered[0]->getTypeName(); $selectedBrandChoice = $itemsFiltered[0]->getBrandName(); $selectedEfficiencyClassChoice = $itemsFiltered[0]->getEfficiencyClassName(); } } ?>