You are here

protected function ProductAttribute::rowUnique in Commerce Migrate 3.1.x

Same name and namespace in other branches
  1. 8.2 modules/magento/src/Plugin/migrate/source/magento2/ProductAttribute.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\ProductAttribute::rowUnique()
  2. 3.0.x modules/magento/src/Plugin/migrate/source/magento2/ProductAttribute.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\ProductAttribute::rowUnique()

Tests if the row is unique.

Parameters

array $row: An array of attribute_name and attribute_value for the current row.

Return value

bool Return TRUE if the row is unique, FALSE if it is not unique.

1 call to ProductAttribute::rowUnique()
ProductAttribute::getYield in modules/magento/src/Plugin/migrate/source/magento2/ProductAttribute.php
Prepare one row per attribute.

File

modules/magento/src/Plugin/migrate/source/magento2/ProductAttribute.php, line 72

Class

ProductAttribute
Yields each product attribute.

Namespace

Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2

Code

protected function rowUnique(array $row) {
  static $unique_rows = [];
  if (in_array($row['attribute'], $unique_rows)) {
    return FALSE;
  }
  array_push($unique_rows, $row['attribute']);
  return TRUE;
}