<?php

namespace common\models;

use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;

class ApiToken extends ActiveRecord
{

    /**
     * Undocumented function
     *
     * @return void
     */
    public static function tableName()
    {
        return 'api_token';
    }

    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            TimestampBehavior::class,
        ];
    }
    public function rules()
    {
        return [
            [['api_name', 'token', 'expires_at'], 'required'],
            [['token'], 'string'],
            [['expires_at', 'created_at', 'updated_at'], 'safe'],
            [['api_name'], 'string', 'max' => 255],
        ];
    }
}
