You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PrestadorSolicitudModel.php 1.9KB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace App\Models;
  3. use CodeIgniter\Model;
  4. class PrestadorSolicitudModel extends Model
  5. {
  6. protected $table = 'rh_prestador_solicitud';
  7. protected $allowedFields = [
  8. 'nombre', 'apaterno', 'amaterno', 'fechanac',
  9. 'direccion', 'colonia', 'municipio', 'cp',
  10. 'telefono', 'celular', 'email',
  11. 'idescuela', 'carrera', 'grado', 'turno',
  12. 'tipo', 'fechainicio', 'iddepartamento_actual', 'horas_servicio',
  13. 'codigo_estudiante', 'horario',
  14. ];
  15. // protected $returnType = \App\Entities\PrestadorSolicitud::class;
  16. protected $useTimestamps = true;
  17. protected $createdField = 'registro_fecha';
  18. // protected $validationRules = [
  19. // 'nombre' => 'required|alpha_space',
  20. // ];
  21. protected $validationRules = [
  22. 'nombre' => 'required',
  23. 'apaterno' => 'required',
  24. 'amaterno' => 'required',
  25. 'fechanac' => 'required|',
  26. 'direccion' => 'required|alpha_numeric_punct',
  27. 'colonia' => 'required|alpha_numeric_punct',
  28. 'municipio' => 'required',
  29. 'cp' => 'required',
  30. 'telefono' => 'required',
  31. 'celular' => 'required',
  32. 'email' => 'required|valid_email',
  33. 'idescuela' => 'required',
  34. 'carrera' => 'required',
  35. 'grado' => 'required',
  36. 'turno' => 'required',
  37. 'tipo' => 'required',
  38. 'fechainicio' => 'required',
  39. 'horas_servicio' => 'required|integer',
  40. ];
  41. protected $validationMessages = [
  42. 'nombre' => [
  43. 'alpha_space' => 'Nombre contiene caracteres no permitidos.',
  44. ]
  45. ];
  46. // protected $validationMessages = [
  47. // 'email' => [
  48. // 'is_unique' => 'Sorry. That email has already been taken. Please choose another.',
  49. // ],
  50. // ];
  51. function getPrestadorSolicitud($id = null)
  52. {
  53. return $this->where('id', $id)->first();
  54. }
  55. }