<?php

namespace common\models;

use common\components\MongoActiveRecord;
use Yii;
use yii\base\InvalidConfigException;

/**
 * This is the model class for collection "ar_alarm_call".
 *
 * @property \MongoDB\BSON\ObjectID|string $_id
 * @property string $trace_id 堆栈ID
 * @property mixed $content 内容
 * @property string $brand 类型
 * @property string $stance 级别
 */
class AlarmCall extends MongoActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function collectionName()
    {
        return 'ar_alarm_call';
    }

    /**
     * @return \yii\mongodb\Connection the MongoDB connection used by this AR class.
     * @throws InvalidConfigException
     */
    public static function getDb()
    {
        return Yii::$app->get('dbLog');
    }

    /**
     * 获取id
     * @return string
     */
    public function getId() {
        return (string) $this->_id;
    }
    /**
     * {@inheritdoc}
     */
    public function attributes()
    {
        return [
            '_id',
            'trace_id',
            'brand',
            'stance',
            'content',
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            '_id' => 'objectID',
            'trace_id' => 'trace_id',
            'content' => 'content',
            'brand' => 'brand',
            'stance' => 'stance',
        ];
    }

}
