Guest User

Untitled

a guest
Jan 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <?php
  2. class Inscricao extends AppModel {
  3. public $name = 'Inscricao';
  4. public $useTable = 'inscricoes';
  5. public $cacheQueries = true;
  6. public $order = array('created' => 'DESC');
  7. public $displayField = 'nome';
  8. public $validate = array(
  9. 'nome' => array(
  10. 'allowEmpty' => false,
  11. 'required' => true,
  12. 'rule' => 'notEmpty',
  13. 'message' => 'O Nome é obrigatório'
  14. ),
  15. 'email' => array(
  16. array(
  17. 'allowEmpty' => false,
  18. 'required' => true,
  19. 'rule' => 'notEmpty',
  20. 'message' => 'O E-mail é obrigatório'
  21. ),
  22. array(
  23. 'rule' => 'email',
  24. 'message' => 'E-mail inválido'
  25. ),
  26. array(
  27. 'rule' => 'isUnique',
  28. 'message' => 'E-mail já cadastrado'
  29. )
  30. ),
  31. 'telefone' => array(
  32. array(
  33. 'allowEmpty' => false,
  34. 'required' => true,
  35. 'rule' => 'notEmpty',
  36. 'message' => 'O Telefone é obrigatório'
  37. ),
  38. array(
  39. 'rule' => 'numeric',
  40. 'message' => 'Telefone inválido'
  41. )
  42. ),
  43. 'endereco' => array(
  44. 'allowEmpty' => false,
  45. 'required' => true,
  46. 'rule' => 'notEmpty',
  47. 'message' => 'O Endereço é obrigatório'
  48. )
  49. );
  50. }
  51. ?>
Add Comment
Please, Sign In to add comment