You are here

public function CommerceSmartImporerService::createSku in Commerce Smart Importer 8

Checks sku validity.

1 call to CommerceSmartImporerService::createSku()
CommerceSmartImporerService::formatField in src/Plugin/CommerceSmartImporerService.php
Formats one field value based on field settings.

File

src/Plugin/CommerceSmartImporerService.php, line 715
Main Commerce Smart Importer Service.

Class

CommerceSmartImporerService
This is main Commerce Smart Importer Service.

Namespace

Drupal\commerce_smart_importer\Plugin

Code

public function createSku($value, $field_definition) {
  if ($this
    ->getVariationIdBySku($value) !== FALSE) {
    throw new Exception("Sku already exists");
  }
  return $value;
}