/** * 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; }
/** * @expectedException \Zend_Db_Statement_Exception */ public function testDeleteTableRow() { $this->_model->deleteTableRow('setup/module', 'module', 'integration_test_fixture_setup'); }