<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "menu_to_the_user".
 *
 * @property integer $id
 * @property string $menu_name
 */
class MenuToTheUser extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'menu_to_the_user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['menu_name'], 'required'],
            [['menu_name'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'menu_name' => Yii::t('app','Menu Name'),
        ];
    }

    public function getDocuments(){
        return $this->hasMany(DocumentsToTheUser::className(), ['menu_to_the_user_id' => 'id']);
    }
}
