configurationRepository = $configurationRepository; $this->carrierBuilder = $carrierBuilder; $this->carrierRepository = $carrierRepository; } /** * @param int $offset * @param int $limit * @param string $langIso * * @return array * * @throws \PrestaShopDatabaseException */ public function getFormattedData($offset, $limit, $langIso) { $language = new Language($this->configurationRepository->get('PS_LANG_DEFAULT')); $currency = new Currency($this->configurationRepository->get('PS_CURRENCY_DEFAULT')); $carriers = Carrier::getCarriers($language->id); /** @var EventBusCarrier[] $eventBusCarriers */ $eventBusCarriers = $this->carrierBuilder->buildCarriers( $carriers, $language, $currency, $this->configurationRepository->get('PS_WEIGHT_UNIT') ); return $eventBusCarriers; } public function getFormattedDataIncremental($limit, $langIso, $objectIds) { $shippingIncremental = $this->carrierRepository->getShippingIncremental('carrier', $langIso); if (!$shippingIncremental) { return []; } $language = new Language($this->configurationRepository->get('PS_LANG_DEFAULT')); $currency = new Currency($this->configurationRepository->get('PS_CURRENCY_DEFAULT')); $carriers = Carrier::getCarriers($language->id); /** @var EventBusCarrier[] $eventBusCarriers */ $eventBusCarriers = $this->carrierBuilder->buildCarriers( $carriers, $language, $currency, $this->configurationRepository->get('PS_WEIGHT_UNIT') ); return $eventBusCarriers; } public function getRemainingObjectsCount($offset, $langIso) { return 0; } }