public static function getProducts() { $objProducts = \Isotope\Model\Product::findPublished(); $arrProductTypeLabels = array(); $arrProducts = array(); while ($objProducts->next()) { // check for label cache if (isset($arrProductTypeLabels[$objProducts->type])) { $strProductTypeLabel = $arrProductTypeLabels[$objProducts->type]; } else { if (($objProductType = \Isotope\Model\ProductType::findByPk($objProducts->type)) !== null) { $strProductTypeLabel = $objProductType->name; $arrProductTypeLabels[$objProductType->id] = $objProductType->name; } } $arrProducts[$objProducts->id] = $strProductTypeLabel . ' - ' . $objProducts->name; } asort($arrProducts); return $arrProducts; }