1 | <?php |
||
25 | class FieldCountValuesCondition extends AbstractConditionItem |
||
26 | { |
||
27 | const CONDITION_IDENTIFIER = 'fieldCountValues'; |
||
28 | |||
29 | /** |
||
30 | * @inheritdoc |
||
31 | * @var array |
||
32 | */ |
||
33 | protected static $javaScriptFiles = [ |
||
34 | 'EXT:formz/Resources/Public/JavaScript/Conditions/Formz.Condition.FieldCountValues.js' |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | * @validate NotEmpty |
||
40 | */ |
||
41 | protected $fieldName; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | protected $minimum; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $maximum; |
||
52 | |||
53 | /** |
||
54 | * @param string $fieldName |
||
55 | * @param string $minimum |
||
56 | * @param string $maximum |
||
57 | */ |
||
58 | public function __construct($fieldName, $minimum, $maximum) |
||
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | public function getJavaScriptResult() |
||
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | public function getPhpResult(PhpConditionDataObject $dataObject) |
||
94 | |||
95 | /** |
||
96 | * Checks the condition configuration/options. |
||
97 | * |
||
98 | * If any syntax/configuration error is found, an exception of type |
||
99 | * `InvalidConditionException` must be thrown. |
||
100 | * |
||
101 | * @param FormDefinition $formDefinition |
||
102 | * @throws InvalidConditionException |
||
103 | */ |
||
104 | protected function checkConditionConfiguration(FormDefinition $formDefinition) |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getCssResult() |
||
118 | } |
||
119 |