AlarmCall.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. 'brand',
  48. 'stance',
  49. 'content',
  50. ];
  51. }
  52. /**
  53. * {@inheritdoc}
  54. */
  55. public function attributeLabels()
  56. {
  57. return [
  58. '_id' => 'objectID',
  59. 'trace_id' => 'trace_id',
  60. 'content' => 'content',
  61. 'brand' => 'brand',
  62. 'stance' => 'stance',
  63. ];
  64. }
  65. }