/** * {@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 product template entity type']; } return parent::validate($object); }