add equipment_type objects
This commit is contained in:
68
common/models/EventEquipmentType.php
Normal file
68
common/models/EventEquipmentType.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "event_equipment_type".
|
||||
*
|
||||
* @property integer $id
|
||||
* @property string $name
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*
|
||||
* @property EventEquipmentTypeAssignment[] $eventEquipmentTypeAssignments
|
||||
* @property EventRegistrationEquipmentTypeAssignment[] $eventRegistrationEquipmentTypeAssignments
|
||||
*/
|
||||
class EventEquipmentType extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'event_equipment_type';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['created_at', 'updated_at'], 'required'],
|
||||
[['created_at', 'updated_at'], 'safe'],
|
||||
[['name'], 'string', 'max' => 255]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => Yii::t('common/event', 'ID'),
|
||||
'name' => Yii::t('common/event', 'Name'),
|
||||
'created_at' => Yii::t('common/event', 'Created At'),
|
||||
'updated_at' => Yii::t('common/event', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getEventEquipmentTypeAssignments()
|
||||
{
|
||||
return $this->hasMany(EventEquipmentTypeAssignment::className(), ['id_event_equipment_type' => 'id']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getEventRegistrationEquipmentTypeAssignments()
|
||||
{
|
||||
return $this->hasMany(EventRegistrationEquipmentTypeAssignment::className(), ['id_event_equipment_type' => 'id']);
|
||||
}
|
||||
}
|
||||
72
common/models/EventEquipmentTypeAssignment.php
Normal file
72
common/models/EventEquipmentTypeAssignment.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "event_equipment_type_assignment".
|
||||
*
|
||||
* @property integer $id
|
||||
* @property integer $id_event
|
||||
* @property integer $id_event_equipment_type
|
||||
* @property integer $count
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*
|
||||
* @property Event $idEvent
|
||||
* @property EventEquipmentType $idEventEquipmentType
|
||||
*/
|
||||
class EventEquipmentTypeAssignment extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'event_equipment_type_assignment';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_event', 'id_event_equipment_type', 'count'], 'integer'],
|
||||
[['created_at', 'updated_at'], 'required'],
|
||||
[['created_at', 'updated_at'], 'safe']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => Yii::t('common/event', 'ID'),
|
||||
'id_event' => Yii::t('common/event', 'Id Event'),
|
||||
'id_event_equipment_type' => Yii::t('common/event', 'Id Event Equipment Type'),
|
||||
'count' => Yii::t('common/event', 'Count'),
|
||||
'created_at' => Yii::t('common/event', 'Created At'),
|
||||
'updated_at' => Yii::t('common/event', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getIdEvent()
|
||||
{
|
||||
return $this->hasOne(Event::className(), ['id' => 'id_event']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \yii\db\ActiveQuery
|
||||
*/
|
||||
public function getIdEventEquipmentType()
|
||||
{
|
||||
return $this->hasOne(EventEquipmentType::className(), ['id' => 'id_event_equipment_type']);
|
||||
}
|
||||
}
|
||||
70
common/models/EventRegistrationEquipmentTypeAssignment.php
Normal file
70
common/models/EventRegistrationEquipmentTypeAssignment.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user