slave_db; } /** * {@inheritdoc} */ public function rules() { return [ [['date'], 'safe'], //[['section', 'error_text'], 'required'], [['error_text'], 'string'], //[['section'], 'integer'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'date' => 'Date', 'section' => 'Section', 'error_text' => 'Error Text', ]; } public static function addlog($section,$text) { $logsModel = new Logs(); $logsModel->section = $section; $logsModel->error_text = $text; $logsModel->save(); //var_dump($logsModel->errors); } public function addlogText($er_text = '',$su_text = '', $section = '') { if ( null == $this->section) { $this->section = $section; } $logsModel = new Logs(); $logsModel->index_t = $this->index_t; $logsModel->section = $this->section; $logsModel->error_text = $er_text; $logsModel->success_text = $su_text; $logsModel->save(); } }