AlarmCall.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace common\models;
  3. use common\components\MongoActiveRecord;
  4. use Yii;
  5. use yii\base\InvalidConfigException;
  6. /**
  7. * This is the model class for collection "ar_alarm_call".
  8. *
  9. * @property \MongoDB\BSON\ObjectID|string $_id
  10. * @property string $trace_id 堆栈ID
  11. * @property mixed $content 内容
  12. */
  13. class AlarmCall extends MongoActiveRecord
  14. {
  15. /**
  16. * {@inheritdoc}
  17. */
  18. public static function collectionName()
  19. {
  20. return 'ar_alarm_call';
  21. }
  22. /**
  23. * @return \yii\mongodb\Connection the MongoDB connection used by this AR class.
  24. * @throws InvalidConfigException
  25. */
  26. public static function getDb()
  27. {
  28. return Yii::$app->get('dbLog');
  29. }
  30. /**
  31. * 获取id
  32. * @return string
  33. */
  34. public function getId() {
  35. return (string) $this->_id;
  36. }
  37. /**
  38. * {@inheritdoc}
  39. */
  40. public function attributes()
  41. {
  42. return [
  43. '_id',
  44. 'trace_id',
  45. 'content',
  46. ];
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function attributeLabels()
  52. {
  53. return [
  54. '_id' => 'objectID',
  55. 'trace_id' => 'trace_id',
  56. 'content' => 'content',
  57. ];
  58. }
  59. }