| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Evento".
- *
- * @property int $id
- * @property string $nombre
- * @property string|null $descripcion
- * @property string|null $fotoEvento
- * @property string|null $tag
- * @property string $url
- * @property string|null $fechaInicio
- * @property string|null $fechaFinal
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- * @property string|null $firebaseId
- * @property string|null $ciudad
- * @property string|null $redSocial
- *
- * @property EventoAccion[] $eventoAccions
- * @property EventoGrupo[] $eventoGrupos
- * @property Grupo[] $grupos
- * @property Red[] $reds
- * @property Resultado[] $resultados
- */
- class Evento extends \yii\db\ActiveRecord {
- /**
- * {@inheritdoc}
- */
- public static function tableName() {
- return 'Evento';
- }
- /**
- * {@inheritdoc}
- */
- public function rules() {
- return [
- [['nombre', 'url'], 'required'],
- [['descripcion', 'fotoEvento'], 'string'],
- [['fechaInicio', 'fechaFinal', 'creado', 'modificado', 'eliminado'], 'safe'],
- [['nombre'], 'string', 'max' => 500],
- [['tag', 'firebaseId'], 'string', 'max' => 50],
- [['url'], 'string', 'max' => 155],
- [['ciudad', 'redSocial'], 'string', 'max' => 100],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels() {
- return [
- 'id' => 'ID',
- 'nombre' => 'Nombre',
- 'descripcion' => 'Descripcion',
- 'fotoEvento' => 'Foto Evento',
- 'tag' => 'Tag',
- 'url' => 'Url',
- 'fechaInicio' => 'Fecha Inicio',
- 'fechaFinal' => 'Fecha Final',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- 'firebaseId' => 'Firebase ID',
- 'ciudad' => 'Ciudad',
- 'redSocial' => 'Red Social',
- ];
- }
- /**
- * Gets query for [[eventoAcciones]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getEventoAcciones() {
- return $this->hasMany(EventoAccion::class, ['idEvento' => 'id']);
- }
- /**
- * Gets query for [[eventoGrupos]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getEventoGrupos() {
- return $this->hasMany(EventoGrupo::class, ['idEvento' => 'id']);
- }
- /**
- * Gets query for [[grupos]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getGrupos() {
- return $this->hasMany(Grupo::class, ['id' => 'idGrupo'])->viaTable('EventoGrupo', ['idEvento' => 'id']);
- }
- /**
- * Gets query for [[redes]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getRedes() {
- return $this->hasMany(Red::class, ['idEvento' => 'id']);
- }
- /**
- * Gets query for [[resultados]].
- *
- * @return \yii\db\ActiveQuery
- */
- public function getResultados() {
- return $this->hasMany(Resultado::class, ['idEvento' => 'id']);
- }
- }
|