Created
August 24, 2022 18:54
-
-
Save codigoconjuan/5953a70f9ddf5722fa97f1991aaf07c2 to your computer and use it in GitHub Desktop.
Validación para Nuevos Eventos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Mensajes de validación para la creación de un evento | |
| public function validar() { | |
| if(!$this->nombre) { | |
| self::$alertas['error'][] = 'El Nombre es Obligatorio'; | |
| } | |
| if(!$this->descripcion) { | |
| self::$alertas['error'][] = 'La descripción es Obligatoria'; | |
| } | |
| if(!$this->categoria_id || !filter_var($this->categoria_id, FILTER_VALIDATE_INT)) { | |
| self::$alertas['error'][] = 'Elige una Categoría'; | |
| } | |
| if(!$this->dia_id || !filter_var($this->dia_id, FILTER_VALIDATE_INT)) { | |
| self::$alertas['error'][] = 'Elige el Día del evento'; | |
| } | |
| if(!$this->hora_id || !filter_var($this->hora_id, FILTER_VALIDATE_INT)) { | |
| self::$alertas['error'][] = 'Elige la hora del evento'; | |
| } | |
| if(!$this->disponibles || !filter_var($this->disponibles, FILTER_VALIDATE_INT)) { | |
| self::$alertas['error'][] = 'Añade una cantidad de Lugares Disponibles'; | |
| } | |
| if(!$this->ponente_id || !filter_var($this->ponente_id, FILTER_VALIDATE_INT) ) { | |
| self::$alertas['error'][] = 'Selecciona la persona encargada del evento'; | |
| } | |
| return self::$alertas; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment