/** * Set entity to use for attributes * * @param \Magento\Eav\Model\Entity\AbstractEntity $entity * @return $this */ public function setEntity($entity) { if ($this->isEnabledFlat() && $entity instanceof \Magento\Framework\Model\Resource\Db\AbstractDb) { $this->_entity = $entity; return $this; } return parent::setEntity($entity); }