LogEippResponse.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\models;
  3. /**
  4. * This is the model class for table "os_log_eipp_response".
  5. *
  6. * @property int $id
  7. * @property string $indx [varchar(255)]
  8. * @property string $desc [varchar(255)]
  9. * @property string $response
  10. * @property int $date [timestamp]
  11. *
  12. * \ */
  13. class LogEippResponse extends \yii\db\ActiveRecord
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public static function tableName()
  19. {
  20. return 'os_log_eipp_response';
  21. }
  22. public static function getDb()
  23. {
  24. return \Yii::$app->slave_db;
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. public function rules()
  30. {
  31. return [
  32. //[['date'], 'safe'],
  33. //[['section', 'error_text'], 'required'],
  34. //[['error_text'], 'string'],
  35. //[['section'], 'integer'],
  36. ];
  37. }
  38. /**
  39. * {@inheritdoc}
  40. */
  41. public function attributeLabels()
  42. {
  43. return [
  44. 'id' => 'ID',
  45. 'date' => 'Date',
  46. 'section' => 'Section',
  47. 'error_text' => 'Error Text',
  48. ];
  49. }
  50. public static function addlog($section,$text,$desc = '')
  51. {
  52. $logsModel = new LogEippResponse();
  53. $logsModel->indx = $section;
  54. $logsModel->response = $text;
  55. $logsModel->desc = $desc;
  56. $logsModel->save();
  57. }
  58. }