modules/admin/controllers/AbuseReportController.php
/**
     * Deletes an existing AbuseReport model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Deletes an existing AbuseReport model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Deletes an existing AbuseReport model . If deletion is successful the browser will be redirected to the ' index ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionDelete($id)
    {
        $model = AbuseReport::findOne($id);
        if (!$model instanceof AbuseReport) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
        $user = $model->user;
        $seller = $model->seller;
        if (!empty($user) && $user instanceof User) {
            $user->user_status = User::USER_STATUS_ACTIVE;
            $user->save(false);
        }
        if (!empty($seller) && $seller instanceof User) {
            $seller->user_status = User::USER_STATUS_ACTIVE;
            $seller->save(false);
        }
        $model->delete();
        \Yii::$app->session->setFlash(Growl::TYPE_SUCCESS, 'Abuse report deleted successfully.');
        return $this->redirect(['index']);
    }
public function actionDelete ( $ id ) { $ model = AbuseReport :: findOne ( $ id ) ; if ( ! $ model instanceof AbuseReport ) { throw new NotFoundHttpException ( 'The requested page does not exist.' ) ; } $ user = $ model -> user ; $ seller = $ model -> seller ; if ( ! empty ( $ user ) && $ user instanceof User ) { $ user -> user_status = User :: USER_STATUS_ACTIVE ; $ user -> save ( false ) ; } if ( ! empty ( $ seller ) && $ seller instanceof User ) { $ seller -> user_status = User :: USER_STATUS_ACTIVE ; $ seller -> save ( false ) ; } $ model -> delete ( ) ; \ Yii :: $ app -> session -> setFlash ( Growl :: TYPE_SUCCESS , 'Abuse report deleted successfully.' ) ; return $ this -> redirect ( [ 'index' ] ) ; }
Deletes an existing AbuseReport model.
Deletes an existing AbuseReport model .