public function actionDelete($id)
 {
     if (Yii::$app->request->isAjax) {
         $transaction = Yii::$app->db->beginTransaction();
         try {
             Grupavid::deleteAll(['id_grupa' => $id]);
             echo $this->findModel($id)->delete();
             $transaction->commit();
         } catch (Exception $e) {
             $transaction->rollBack();
             throw new Exception($e->getMessage());
         }
     }
 }
Exemple #2
0
 /**
  * @depends loadData
  */
 public function destroyData()
 {
     Grupavid::deleteAll();
     Grupa::deleteAll();
     Matvid::deleteAll();
 }