You are here

public function CSVUpdateForm::hasIdentifier in Commerce Smart Importer 8

Checks if array contains at least one product identifier.

1 call to CSVUpdateForm::hasIdentifier()
CSVUpdateForm::submitForm in src/Form/CSVUpdateForm.php
Form submit.

File

src/Form/CSVUpdateForm.php, line 451

Class

CSVUpdateForm
Class CSVUpdateForm.

Namespace

Drupal\commerce_smart_importer\Form

Code

public function hasIdentifier($field_definitions, $type) {
  $identifiers = $this->smartImporterService
    ->getIdentifierFields();
  foreach ($field_definitions[$type] as $field_definition) {
    if (in_array($field_definition['machine_names'], $identifiers[$type])) {
      return TRUE;
    }
  }
  return FALSE;
}