Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SuperProductsSku.php
Go to the documentation of this file.
1 <?php
7 
10 
12 {
16  protected $skuProcessor;
17 
21  public function __construct(
23  ) {
24  $this->skuProcessor = $skuProcessor;
25  }
26 
30  public function isValid($value)
31  {
32  $this->_clearMessages();
33  $oldSku = $this->skuProcessor->getOldSkus();
34  if (!empty($value['_super_products_sku'])) {
35  $superSku = strtolower($value['_super_products_sku']);
36  if (!isset($oldSku[$superSku])
37  && $this->skuProcessor->getNewSku($superSku) === null
38  ) {
39  $this->_addMessages([self::ERROR_SUPER_PRODUCTS_SKU_NOT_FOUND]);
40  return false;
41  }
42  }
43  return true;
44  }
45 }
$value
Definition: gender.phtml:16