/** * Remove Attribute * * @param int|string $entityTypeId * @param int|string $code * @return $this */ public function removeAttribute($entityTypeId, $code) { $mainTable = $this->setup->getTable('eav_attribute'); $attribute = $this->getAttribute($entityTypeId, $code); if ($attribute) { $this->setup->deleteTableRow('eav_attribute', 'attribute_id', $attribute['attribute_id']); $setupCache = $this->setup->getSetupCache(); if ($setupCache->has($mainTable, $attribute['entity_type_id'], $attribute['attribute_code'])) { $setupCache->remove($mainTable, $attribute['entity_type_id'], $attribute['attribute_code']); } } return $this; }
public function testGetSetupCache() { $this->assertInstanceOf('Magento\\Framework\\Setup\\DataCacheInterface', $this->_model->getSetupCache()); }