/**
  * Get rma items.
  *
  * @param Rma $rma
  * @return array
  */
 protected function getRmaItems(Rma $rma)
 {
     $rmaItems = $rma->getItems();
     /** @var Order $order */
     $order = $rma->getDataFieldConfig('order_id')['source']->getOrder();
     $orderItems = $this->getAssignedProducts($order);
     foreach ($rmaItems as $productKey => $productData) {
         $key = str_replace('product_key_', '', $productKey);
         $product = $orderItems[$key];
         $productData['sku'] = $this->productHandlerClass->getProductSku($product);
         $productData['qty'] = $productData['qty_requested'];
         $productData['product_name'] = $product->getName();
         $productOptions = $this->productHandlerClass->getProductOptions($product);
         if ($productOptions != null) {
             $productData['options'] = $productOptions;
         }
         if (!isset($productData['status'])) {
             $productData['status'] = self::ITEM_DEFAULT_STATUS;
         }
         unset($productData['reason']);
         unset($productData['reason_other']);
         $rmaItems[$productKey] = $productData;
     }
     return $rmaItems;
 }
 /**
  * Get product options.
  *
  * @param InjectableFixture $product
  * @return array
  */
 public function getProductOptions(InjectableFixture $product)
 {
     $options = $this->getCheckoutDataOptions($product, 'configurable_options');
     $productOptions = $product->getConfigurableOptions()['attributes_data'];
     $configurableOptions = !empty($options) && !empty($productOptions) ? $this->getOptions($options, $productOptions, 'label', false) : [];
     return array_merge(parent::getProductOptions($product), $configurableOptions);
 }
 /**
  * Get product data.
  *
  * @param InjectableFixture $product
  * @return array
  */
 protected function getProductData(InjectableFixture $product)
 {
     $productData['product'] = ['name' => $this->getProductName($product), 'sku' => $this->productHandlerClass->getProductSku($product)];
     $productOptions = $this->productHandlerClass->getProductOptions($product);
     if ($productOptions != null) {
         $productData['product']['options'] = $productOptions;
     }
     return $productData;
 }