You are here

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

Same name and namespace in other branches
  1. 8.2 modules/magento/src/Plugin/migrate/source/magento2/Category.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\Category::rowUnique()
  2. 3.0.x modules/magento/src/Plugin/migrate/source/magento2/Category.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\Category::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 Category::rowUnique()
Category::getYield in modules/magento/src/Plugin/migrate/source/magento2/Category.php
Prepare one row per taxonomy vocabulary in the source data.

File

modules/magento/src/Plugin/migrate/source/magento2/Category.php, line 73

Class

Category
Yields each taxonomy vocabulary.

Namespace

Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2

Code

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