<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "event_registration_equipment_type_assignment".
 *
 * @property integer $id
 * @property integer $id_event_equipment_type
 * @property integer $id_event_registration
 * @property string $created_at
 * @property string $updated_at
 *
 * @property EventRegistration $idEventRegistration
 * @property EventEquipmentType $idEventEquipmentType
 */
class EventRegistrationEquipmentTypeAssignment extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'event_registration_equipment_type_assignment';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id_event_equipment_type', 'id_event_registration'], 'integer'],
            [['created_at', 'updated_at'], 'required'],
            [['created_at', 'updated_at'], 'safe']
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('common/event', 'ID'),
            'id_event_equipment_type' => Yii::t('common/event', 'Id Event Equipment Type'),
            'id_event_registration' => Yii::t('common/event', 'Id Event Registration'),
            'created_at' => Yii::t('common/event', 'Created At'),
            'updated_at' => Yii::t('common/event', 'Updated At'),
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getIdEventRegistration()
    {
        return $this->hasOne(EventRegistration::className(), ['id' => 'id_event_registration']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getIdEventEquipmentType()
    {
        return $this->hasOne(EventEquipmentType::className(), ['id' => 'id_event_equipment_type']);
    }
}
