function validar_estado() { $padre = parent::validar_estado(); if ($padre !== true) { return $padre; } if (!empty($this->estado)) { return $this->validar_cbu($this->estado); } else { return true; } }
/** * Valida que sea una fecha válida con la funcion php checkdate */ function validar_estado() { $padre = parent::validar_estado(); if ($padre !== true) { return $padre; } if ($this->tiene_estado()) { if ($this->confirma_excepcion_validacion()) { return true; } $hora = explode(':', $this->estado); if (!is_numeric($hora[0]) || !is_numeric($hora[1])) { return "El campo no es una hora valida (1)."; } if (!checktime($hora[0], $hora[1])) { return "El campo no es una hora valida (2)."; } } return true; }