1 | <?php |
||
26 | class FieldIsEmptyCondition extends AbstractConditionItem |
||
27 | { |
||
28 | const CONDITION_IDENTIFIER = 'fieldIsEmpty'; |
||
29 | |||
30 | /** |
||
31 | * @inheritdoc |
||
32 | * @var array |
||
33 | */ |
||
34 | protected static $javaScriptFiles = [ |
||
35 | 'EXT:formz/Resources/Public/JavaScript/Conditions/Formz.Condition.FieldIsEmpty.js' |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | * @var string |
||
40 | * @validate NotEmpty |
||
41 | */ |
||
42 | protected $fieldName; |
||
43 | |||
44 | /** |
||
45 | * @param string $fieldName |
||
46 | */ |
||
47 | public function __construct($fieldName) |
||
51 | |||
52 | /** |
||
53 | * @inheritdoc |
||
54 | */ |
||
55 | public function getCssResult() |
||
59 | |||
60 | /** |
||
61 | * @inheritdoc |
||
62 | */ |
||
63 | public function getJavaScriptResult() |
||
67 | |||
68 | /** |
||
69 | * @inheritdoc |
||
70 | */ |
||
71 | public function getPhpResult(PhpConditionDataObject $dataObject) |
||
77 | |||
78 | /** |
||
79 | * Checks the condition configuration/options. |
||
80 | * |
||
81 | * If any syntax/configuration error is found, an exception of type |
||
82 | * `InvalidConditionException` must be thrown. |
||
83 | * |
||
84 | * @param FormDefinition $formDefinition |
||
85 | * @throws InvalidConditionException |
||
86 | */ |
||
87 | protected function checkConditionConfiguration(FormDefinition $formDefinition) |
||
93 | } |
||
94 |