You are here

public function ShipmentItem::toArray in Commerce Shipping 8.2

Same name in this branch
  1. 8.2 src/ShipmentItem.php \Drupal\commerce_shipping\ShipmentItem::toArray()
  2. 8.2 src/Plugin/DataType/ShipmentItem.php \Drupal\commerce_shipping\Plugin\DataType\ShipmentItem::toArray()

Gets the array representation of the shipment item.

Return value

array|null The array.

File

src/Plugin/DataType/ShipmentItem.php, line 30

Class

ShipmentItem
Plugin annotation @DataType( id = "shipment_item", label = @Translation("Shipment item"), description = @Translation("Shipment item."), definition_class = "\Drupal\commerce_shipping\TypedData\ShipmentItemDataDefinition" )

Namespace

Drupal\commerce_shipping\Plugin\DataType

Code

public function toArray() {
  return $this->value ? $this->value
    ->toArray() : NULL;
}