/** * Get related log query. * * @return [[@doctodo return_type:getRelatedLogQuery]] [[@doctodo return_description:getRelatedLogQuery]] */ public function getRelatedLogQuery() { return DataInterfaceLog::find()->where(['data_interface_id' => $this->primaryKey]); }
/** * [[@doctodo method_description:actionViewLog]]. * * @throws HttpException [[@doctodo exception_description:HttpException]] * @return [[@doctodo return_type:actionViewLog]] [[@doctodo return_description:actionViewLog]] * */ public function actionViewLog() { if (empty($_GET['id']) || !($dataInterfaceLog = DataInterfaceLog::get($_GET['id']))) { throw new HttpException(404, 'Data interface log could not be found'); } $this->params['dataInterfaceLog'] = $dataInterfaceLog; if (Yii::$app->request->isAjax && !empty($_GET['package'])) { Yii::$app->response->data = $dataInterfaceLog->dataPackage; return; } elseif (Yii::$app->request->isAjax) { Yii::$app->response->taskOptions = ['title' => 'View Log', 'modalClass' => 'modal-xl']; Yii::$app->response->task = 'dialog'; } if ($dataInterfaceLog->status === 'queued') { Yii::$app->response->view = 'view_log_queued'; } else { Yii::$app->response->view = 'view_log'; } }
/** * Get log model. * * @param boolean $refresh [[@doctodo param_description:refresh]] [optional] * * @return [[@doctodo return_type:getLogModel]] [[@doctodo return_description:getLogModel]] */ public function getLogModel($refresh = false) { $config = $this->config; if (isset($config['logModel'])) { if (!is_object($config['logModel'])) { if ($refresh) { return DataInterfaceLog::find()->where(['id' => $config['logModel']])->one(); } else { return DataInterfaceLog::get($config['logModel']); } } if ($refresh) { return DataInterfaceLog::find()->where(['id' => $config['logModel']->primaryKey])->one(); } return $config['logModel']; } return; }