link = $link; $this->carriersConfiguration = $carriersConfiguration; } public function present(InPostCarrierModel $inPostCarrier) { $carrier = $inPostCarrier->getCarrier(); return [ 'id' => $inPostCarrier->id, 'service' => $inPostCarrier->service, 'cod' => (bool) $inPostCarrier->cod, 'weekendDelivery' => (bool) $inPostCarrier->weekend_delivery, 'defaultTemplate' => in_array($inPostCarrier->service, Service::LOCKER_SERVICES) ? $this->carriersConfiguration->getDefaultDimensionTemplates($inPostCarrier->service) : null, 'defaultDimensions' => $this->carriersConfiguration->getDefaultShipmentDimensions($inPostCarrier->service), 'defaultSendingMethod' => $this->carriersConfiguration->getDefaultSendingMethods($inPostCarrier->service), 'useProductDimensions' => (bool) $inPostCarrier->use_product_dimensions, 'carrier' => $carrier->name, 'active' => (bool) $carrier->active, 'editUrl' => $this->link->getAdminLink('AdminCarrierWizard', true, [], [ 'id_carrier' => $carrier->id, ]), ]; } }