lib/controllers/admin/InterfaceController.php
public function actionRun()
    {
        if (empty($_GET['id']) || !($dataInterface = DataInterface::get($_GET['id']))) {
            throw new HttpException(404, 'Data interface could not be found');
        }
        $lastLog = $dataInterface->lastDataInterfaceLog;
        if (!empty($lastLog) && $lastLog->isActive) {
            Yii::$app->response->error = 'There is already an active interface action.';
            Yii::$app->response->refresh = true;

            return;
        }

        $log = new DataInterfaceLog();
        $log->data_interface_id = $dataInterface->primaryKey;
        if (!$log->save()) {
            Yii::$app->response->error = 'An error occurred while starting the data interface log.';
            Yii::$app->response->refresh = true;

            return;
        }

        $deferredAction = DeferredAction::setup(['logModel' => $log->primaryKey]);
        if (!$deferredAction) {
            throw new NotFoundHttpException("Deferred action could not be started!");
        }
        Yii::$app->response->task = 'client';
        Yii::$app->response->clientTask = 'deferredAction';
        Yii::$app->response->taskOptions = $deferredAction->package();
    }
public function actionRun()
    {
        if (empty($_GET['id']) || !($dataInterface = DataInterface::get($_GET['id']))) {
            throw new HttpException(404, 'Data interface could not be found');
        }
        $lastLog = $dataInterface->lastDataInterfaceLog;
        if (!empty($lastLog) && $lastLog->isActive) {
            Yii::$app->response->error = 'There is already an active interface action.';
            Yii::$app->response->refresh = true;

            return;
        }

        $log = new DataInterfaceLog();
        $log->data_interface_id = $dataInterface->primaryKey;
        if (!$log->save()) {
            Yii::$app->response->error = 'An error occurred while starting the data interface log.';
            Yii::$app->response->refresh = true;

            return;
        }

        $deferredAction = DeferredAction::setup(['logModel' => $log->primaryKey]);
        if (!$deferredAction) {
            throw new NotFoundHttpException("Deferred action could not be started!");
        }
        Yii::$app->response->task = 'client';
        Yii::$app->response->clientTask = 'deferredAction';
        Yii::$app->response->taskOptions = $deferredAction->package();
    }
[[@doctodo method_description:actionRun]].

@throws HttpException         [[@doctodo exception_description:HttpException]]
@throws NotFoundHttpException [[@doctodo exception_description:NotFoundHttpException]]
@return [[@doctodo return_type:actionRun]] [[@doctodo return_description:actionRun]]