summaryrefslogtreecommitdiff
path: root/libs/SimpleValidator/Validators/NotInArray.php
diff options
context:
space:
mode:
Diffstat (limited to 'libs/SimpleValidator/Validators/NotInArray.php')
-rw-r--r--libs/SimpleValidator/Validators/NotInArray.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/SimpleValidator/Validators/NotInArray.php b/libs/SimpleValidator/Validators/NotInArray.php
new file mode 100644
index 00000000..98974c9c
--- /dev/null
+++ b/libs/SimpleValidator/Validators/NotInArray.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace SimpleValidator\Validators;
+
+class NotInArray extends InArray
+{
+ public function execute(array $data)
+ {
+ if ($this->isFieldNotEmpty($data)) {
+ return ! in_array($data[$this->field], $this->array);
+ }
+
+ return true;
+ }
+}