Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31f65d2 commit 1917d9cCopy full SHA for 1917d9c
1 file changed
lib/validator/mmValidatorReadOnly.class.php
@@ -0,0 +1,33 @@
1
+<?php
2
+
3
+/**
4
+ * mmValidatorReadOnly validates that the value has not been changed.
5
+ *
6
7
+ */
8
+class mmValidatorReadOnly extends sfValidatorBase
9
+{
10
+ /**
11
+ * Configures the current validator.
12
13
+ * Available options:
14
15
+ * * value: The value to be compared against (required)
16
17
+ * @see sfValidatorBase
18
19
+ protected function configure($options = array(), $messages = array())
20
+ {
21
+ $this->addRequiredOption('value');
22
+ $this->setOption('required', false);
23
+ }
24
25
26
27
28
+ protected function doClean($value)
29
30
+ //if($value != $this->getOption('value'))
31
+ return $this->getOption('value');
32
33
+}
0 commit comments