Source for file Rule.php

Documentation is available at Rule.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette\Forms
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * Single validation rule or condition represented as value object.
  17. 17:  *
  18. 18:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  19. 19:  * @package    Nette\Forms
  20. 20:  */
  21. 21: final class Rule extends Object
  22. 22: {
  23. 23:     /** type */
  24. 24:     const CONDITION = 1;
  25. 25:  
  26. 26:     /** type */
  27. 27:     const VALIDATOR = 2;
  28. 28:  
  29. 29:     /** type */
  30. 30:     const FILTER = 3;
  31. 31:  
  32. 32:     /** type */
  33. 33:     const TERMINATOR = 4;
  34. 34:  
  35. 35:     /** @var IFormControl */
  36. 36:     public $control;
  37. 37:  
  38. 38:     /** @var mixed */
  39. 39:     public $operation;
  40. 40:  
  41. 41:     /** @var mixed */
  42. 42:     public $arg;
  43. 43:  
  44. 44:     /** @var int (CONDITION, VALIDATOR, FILTER) */
  45. 45:     public $type;
  46. 46:  
  47. 47:     /** @var bool */
  48. 48:     public $isNegative = FALSE;
  49. 49:  
  50. 50:     /** @var string (only for VALIDATOR type) */
  51. 51:     public $message;
  52. 52:  
  53. 53:     /** @var bool (only for VALIDATOR type) */
  54. 54:     public $breakOnFailure = TRUE;
  55. 55:  
  56. 56:     /** @var Rules (only for CONDITION type)  */
  57. 57:     public $subRules;
  58. 58:  
  59. 59: }