/** * Return total list * * @return \Magento\Sales\Model\Order\Pdf\Total\DefaultTotal */ protected function _getTotalsList() { $totals = $this->_pdfConfig->getTotals(); usort($totals, array($this, '_sortTotalsList')); $totalModels = array(); foreach ($totals as $totalInfo) { $class = empty($totalInfo['model']) ? null : $totalInfo['model']; $totalModel = $this->_pdfTotalFactory->create($class); $totalModel->setData($totalInfo); $totalModels[] = $totalModel; } return $totalModels; }