public static function getOrders(\DataContainer $objDc) { $arrOptions = array(); if (($objSubscription = \Isotope\Model\Subscription::findByPk($objDc->activeRecord->id)) !== null) { if (($objOrders = \Isotope\Model\ProductCollection\Order::findByType('order')) !== null) { while ($objOrders->next()) { foreach ($objOrders->current()->getItems() as $objItem) { // the order needs to contain at least one item of the product type defined in the archive if (($objProduct = $objItem->getProduct()) !== null && $objProduct->type == $objSubscription->getRelated('pid')->productType) { $arrOptions[$objOrders->id] = $GLOBALS['TL_LANG']['MSC']['order'] . ' ' . $objOrders->document_number; break; } } } } // inverse asort arsort($arrOptions); } return $arrOptions; }