Example #1
0
 public function afterDelete()
 {
     // Clear type attribute relations
     StoreTypeAttribute::model()->deleteAllByAttributes(array('type_id' => $this->id));
     return parent::afterDelete();
 }
Example #2
0
 public function afterDelete()
 {
     // Delete options
     foreach ($this->options as $o) {
         $o->delete();
     }
     // Delete relations used in product type.
     StoreTypeAttribute::model()->deleteAllByAttributes(array('attribute_id' => $this->id));
     // Delete attributes assigned to products
     $conn = $this->getDbConnection();
     $command = $conn->createCommand("DELETE FROM `StoreProductAttributeEAV` WHERE `attribute`='{$this->name}'");
     $command->execute();
     return parent::afterDelete();
 }