AlarmCall.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. * @property string $brand 类型
  13. * @property string $stance 级别
  14. */
  15. class AlarmCall extends MongoActiveRecord
  16. {
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public static function collectionName()
  21. {
  22. return 'ar_alarm_call';
  23. }
  24. /**
  25. * @return \yii\mongodb\Connection the MongoDB connection used by this AR class.
  26. * @throws InvalidConfigException
  27. */
  28. public static function getDb()
  29. {
  30. return Yii::$app->get('dbLog');
  31. }
  32. /**
  33. * 获取id
  34. * @return string
  35. */
  36. public function getId() {
  37. return (string) $this->_id;
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function attributes()
  43. {
  44. return [
  45. '_id',
  46. 'trace_id',
  47. 'content',
  48. ];
  49. }
  50. /**
  51. * {@inheritdoc}
  52. */
  53. public function attributeLabels()
  54. {
  55. return [
  56. '_id' => 'objectID',
  57. 'trace_id' => 'trace_id',
  58. 'content' => 'content',
  59. ];
  60. }
  61. }