| 1 | <?php |
||
| 10 | class FieldValueDependency implements RuleCondition |
||
| 11 | { |
||
| 12 | const VALUE_EQUAL = '='; |
||
| 13 | const VALUE_NOT_EQUAL = '!='; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Dependent field |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | public $field; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | public $condition; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var mixed |
||
| 28 | */ |
||
| 29 | public $value; |
||
| 30 | |||
| 31 | public function __construct($field, $condition = self::VALUE_EQUAL, $value) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | */ |
||
| 41 | public function macro() |
||
| 45 | } |
||
| 46 |