Ejemplo n.º 1
0
 /**
  * [[@doctodo method_description:actionViewLogs]].
  *
  * @throws HttpException [[@doctodo exception_description:HttpException]]
  */
 public function actionViewLogs()
 {
     if (empty($_GET['id']) || !($dataInterface = DataInterface::get($_GET['id']))) {
         throw new HttpException(404, 'Data interface could not be found');
     }
     $this->params['dataInterface'] = $dataInterface;
     Yii::$app->response->view = 'view_logs';
 }
Ejemplo n.º 2
0
 /**
  * Get key translations.
  *
  * @return \yii\db\ActiveRelation
  */
 public function getKeyTranslations()
 {
     return $this->hasMany(DataInterface::className(), ['data_interface_id' => 'id']);
 }
Ejemplo n.º 3
0
 /**
  * Get data interface.
  *
  * @return \yii\db\ActiveRelation
  */
 public function getDataInterface()
 {
     return $this->hasOne(DataInterface::className(), ['id' => 'data_interface_id']);
 }
Ejemplo n.º 4
0
 /**
  * Get interface object.
  *
  * @throws Exception [[@doctodo exception_description:Exception]]
  * @return [[@doctodo return_type:getInterfaceObject]] [[@doctodo return_description:getInterfaceObject]]
  *
  */
 public function getInterfaceObject()
 {
     if (is_null($this->_interfaceObject)) {
         $this->_interfaceObject = DataInterface::find()->where(['system_id' => $this->object->systemId])->one();
         if (empty($this->_interfaceObject)) {
             $this->_interfaceObject = new DataInterface();
             $this->_interfaceObject->name = $this->object->name;
             $this->_interfaceObject->system_id = $this->object->systemId;
             if (!$this->_interfaceObject->save()) {
                 var_dump($this->_interfaceObject->errors);
                 throw new Exception("Unable to save interface object!");
             }
         }
     }
     return $this->_interfaceObject;
 }