|
@@ -9,6 +9,9 @@ use Yii;
|
|
|
*
|
|
*
|
|
|
* @property int $idEvento
|
|
* @property int $idEvento
|
|
|
* @property int $idGrupo
|
|
* @property int $idGrupo
|
|
|
|
|
+ *
|
|
|
|
|
+ * @property Evento $evento
|
|
|
|
|
+ * @property Grupo $grupo
|
|
|
*/
|
|
*/
|
|
|
class EventoGrupo extends \yii\db\ActiveRecord {
|
|
class EventoGrupo extends \yii\db\ActiveRecord {
|
|
|
/**
|
|
/**
|
|
@@ -27,6 +30,8 @@ class EventoGrupo extends \yii\db\ActiveRecord {
|
|
|
[['idEvento', 'idGrupo'], 'default', 'value' => null],
|
|
[['idEvento', 'idGrupo'], 'default', 'value' => null],
|
|
|
[['idEvento', 'idGrupo'], 'integer'],
|
|
[['idEvento', 'idGrupo'], 'integer'],
|
|
|
[['idEvento', 'idGrupo'], 'unique', 'targetAttribute' => ['idEvento', 'idGrupo']],
|
|
[['idEvento', 'idGrupo'], 'unique', 'targetAttribute' => ['idEvento', 'idGrupo']],
|
|
|
|
|
+ [['idEvento'], 'exist', 'skipOnError' => true, 'targetClass' => Evento::className(), 'targetAttribute' => ['idEvento' => 'id']],
|
|
|
|
|
+ [['idGrupo'], 'exist', 'skipOnError' => true, 'targetClass' => Grupo::className(), 'targetAttribute' => ['idGrupo' => 'id']],
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -39,4 +44,22 @@ class EventoGrupo extends \yii\db\ActiveRecord {
|
|
|
'idGrupo' => 'Id Grupo',
|
|
'idGrupo' => 'Id Grupo',
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Gets query for [[evento]].
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getEvento() {
|
|
|
|
|
+ return $this->hasOne(Evento::className(), ['id' => 'idEvento']);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Gets query for [[grupo]].
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
|
|
+ */
|
|
|
|
|
+ public function getGrupo() {
|
|
|
|
|
+ return $this->hasOne(Grupo::className(), ['id' => 'idGrupo']);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|