Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function validate($object)
 {
     //validate attribute set entity type
     $entityType = $this->typeFactory->create()->loadByCode(\Magento\Catalog\Model\Product::ENTITY);
     $attributeSet = $this->setFactory->create()->load($object->getAttributeSetId());
     if ($attributeSet->getEntityTypeId() != $entityType->getId()) {
         return ['attribute_set' => 'Invalid attribute set entity type'];
     }
     return parent::validate($object);
 }