<?php

namespace backendApi\modules\v1\models;

use Yii;

/**
 * This is the model class for table "{{%ADMIN_TOKEN}}".
 *
 * @property string $ID
 * @property string $ADMIN_ID 管理员ID
 * @property string $PC_ACCESS_TOKEN PC认证Token
 * @property string $APP_ACCESS_TOKEN APP认证Token
 * @property string $PC_REFRESH_TOKEN PC刷新Token
 * @property string $APP_REFRESH_TOKEN APP刷新Token
 * @property int $CREATED_AT 创建时间
 * @property int $PAT_UPDATED_AT PCAccessToken更新时间
 * @property int $AAT_UPDATED_AT AppAccessToken更新时间
 * @property int $PRT_UPDATED_AT PCRefreshToken更新时间
 * @property int $ART_UPDATED_AT PCRefreshToken更新时间
 */
class AdminToken extends \common\components\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%ADMIN_TOKEN}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ADMIN_ID', 'CREATED_AT'], 'required'],
            [['CREATED_AT', 'PAT_UPDATED_AT', 'AAT_UPDATED_AT', 'PRT_UPDATED_AT', 'ART_UPDATED_AT'], 'integer'],
            [['ID', 'ADMIN_ID'], 'string', 'max' => 32],
            [['PC_ACCESS_TOKEN', 'APP_ACCESS_TOKEN', 'PC_REFRESH_TOKEN', 'APP_REFRESH_TOKEN'], 'string', 'max' => 255],
            [['APP_ACCESS_TOKEN'], 'unique'],
            [['APP_REFRESH_TOKEN'], 'unique'],
            [['PC_ACCESS_TOKEN'], 'unique'],
            [['PC_REFRESH_TOKEN'], 'unique'],
            [['ID'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'ADMIN_ID' => '管理员ID',
            'PC_ACCESS_TOKEN' => 'PC认证Token',
            'APP_ACCESS_TOKEN' => 'APP认证Token',
            'PC_REFRESH_TOKEN' => 'PC刷新Token',
            'APP_REFRESH_TOKEN' => 'APP刷新Token',
            'CREATED_AT' => '创建时间',
            'PAT_UPDATED_AT' => 'PCAccessToken更新时间',
            'AAT_UPDATED_AT' => 'AppAccessToken更新时间',
            'PRT_UPDATED_AT' => 'PCRefreshToken更新时间',
            'ART_UPDATED_AT' => 'PCRefreshToken更新时间',
        ];
    }
}
