Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
ShippingLabelConverter Class Reference

Public Member Functions

 afterGet (\Magento\Sales\Api\ShipmentRepositoryInterface $shipmentRepository, \Magento\Sales\Api\Data\ShipmentInterface $shipment)
 

Detailed Description

Plugin to convert shipping label from blob to base64encoded string

Definition at line 13 of file ShippingLabelConverter.php.

Member Function Documentation

◆ afterGet()

Convert shipping label from blob to base64encoded string

Parameters
\Magento\Sales\Api\ShipmentRepositoryInterface$shipmentRepository
\Magento\Sales\Api\Data\ShipmentInterface$shipment
Returns
\Magento\Sales\Api\Data\ShipmentInterface

@SuppressWarnings(PHPMD.UnusedFormalParameter)

Definition at line 46 of file ShippingLabelConverter.php.

49  {
50  if ($shipment->getShippingLabel() !== null) {
51  $shipment->setShippingLabel(base64_encode($shipment->getShippingLabel()));
52  }
53  return $shipment;
54  }
foreach($order->getItems() as $orderItem) $shipment

The documentation for this class was generated from the following file: