<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "mcp_accesslogs".
 *
 * @property integer $user_id
 * @property string $browser
 * @property string $ip
 * @property string $session
 * @property string $intime
 * @property string $outtime
 */
class McpAccesslogs extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'mcp_accesslogs';
    }

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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id'], 'integer'],
            [['intime', 'outtime'], 'safe'],
            [['browser'], 'string', 'max' => 255],
            [['ip'], 'string', 'max' => 30],
            [['session'], 'string', 'max' => 40]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_id' => 'user,s reference',
            'browser' => 'Browser',
            'ip' => 'Ip',
            'session' => 'Session',
            'intime' => 'Intime',
            'outtime' => 'Outtime',
        ];
    }
}
