<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "admin_menu_access_group".
 *
 * @property integer $admin_menu_access_group_id
 * @property integer $admin_menu_id
 * @property string $group
 *
 * @property AdminMenu $menu
 * @property AuthRule $group0
 */
class AdminMenuAccessGroup extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'admin_menu_access_group';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['admin_menu_id'], 'integer'],
            [['group'], 'string']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'admin_menu_access_group_id' => Yii::t('app', 'Admin Access Group ID'),
            'admin_menu_id' => Yii::t('app', 'Admin Menu ID'),
            'group' => Yii::t('app', 'Group'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getMenu()
    {
        return $this->hasOne(AdminMenu::className(), ['admin_menu_id' => 'admin_menu_id']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getGroup0()
    {
        return $this->hasOne(AuthRule::className(), ['name' => 'group']);
    }
}
