EventoGrupo.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace app\models;
  3. use Yii;
  4. /**
  5. * This is the model class for table "EventoGrupo".
  6. *
  7. * @property int $idEvento
  8. * @property int $idGrupo
  9. *
  10. * @property Evento $evento
  11. * @property Grupo $grupo
  12. */
  13. class EventoGrupo extends \yii\db\ActiveRecord {
  14. /**
  15. * {@inheritdoc}
  16. */
  17. public static function tableName() {
  18. return 'EventoGrupo';
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function rules() {
  24. return [
  25. [['idEvento', 'idGrupo'], 'required'],
  26. [['idEvento', 'idGrupo'], 'default', 'value' => null],
  27. [['idEvento', 'idGrupo'], 'integer'],
  28. [['idEvento', 'idGrupo'], 'unique', 'targetAttribute' => ['idEvento', 'idGrupo']],
  29. [['idEvento'], 'exist', 'skipOnError' => true, 'targetClass' => Evento::className(), 'targetAttribute' => ['idEvento' => 'id']],
  30. [['idGrupo'], 'exist', 'skipOnError' => true, 'targetClass' => Grupo::className(), 'targetAttribute' => ['idGrupo' => 'id']],
  31. ];
  32. }
  33. /**
  34. * {@inheritdoc}
  35. */
  36. public function attributeLabels() {
  37. return [
  38. 'idEvento' => 'Id Evento',
  39. 'idGrupo' => 'Id Grupo',
  40. ];
  41. }
  42. /**
  43. * Gets query for [[evento]].
  44. *
  45. * @return \yii\db\ActiveQuery
  46. */
  47. public function getEvento() {
  48. return $this->hasOne(Evento::className(), ['id' => 'idEvento']);
  49. }
  50. /**
  51. * Gets query for [[grupo]].
  52. *
  53. * @return \yii\db\ActiveQuery
  54. */
  55. public function getGrupo() {
  56. return $this->hasOne(Grupo::className(), ['id' => 'idGrupo']);
  57. }
  58. }