Exemple #1
0
 public function afterDelete()
 {
     $transac = Yii::app()->db->beginTransaction();
     // Si tiene conyuge lo elimino
     if ($this->idconyuge > 0) {
         $resu = $this->idconyuge0->delete();
         if (!$resu) {
             $transac->rollback();
             throw new Exception("Error al borrar el cónyuge");
         }
     }
     // Si tiene datos impositivos los borro
     if ($this->iddatoimpositivo > 0) {
         $resu = $this->iddatoimpositivo0->delete();
         if (!$resu) {
             $transac->rollback();
             throw new Exception("Error al borrar los datos impositivos");
         }
     }
     $transac->commit();
     parent::afterDelete();
 }