1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: */
7:
8: namespace Nette\Forms;
9:
10: use Nette;
11:
12:
13: /**
14: * Single validation rule or condition represented as value object.
15: *
16: * @author David Grudl
17: */
18: class Rule extends Nette\Object
19: {
20: /** type */
21: const CONDITION = 1;
22:
23: /** type */
24: const VALIDATOR = 2;
25:
26: /** type */
27: const FILTER = 3;
28:
29: /** @var IControl */
30: public $control;
31:
32: /** @var mixed */
33: public $operation;
34:
35: /** @var mixed */
36: public $arg;
37:
38: /** @var int (CONDITION, VALIDATOR, FILTER) */
39: public $type;
40:
41: /** @var bool */
42: public $isNegative = FALSE;
43:
44: /** @var string (only for VALIDATOR type) */
45: public $message;
46:
47: /** @var Rules (only for CONDITION type) */
48: public $subRules;
49:
50: }
51: