summaryrefslogtreecommitdiff
path: root/app/Validator
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-11-02 15:41:58 -0700
committerFrederic Guillot <fred@kanboard.net>2017-11-02 15:41:58 -0700
commit648dc6bcfbdd44947ec58e2f3662c1cc3844d782 (patch)
treed122630decf0bf4a7a199798835481592424a3b0 /app/Validator
parent44ae87ac0e9bb37ca6d2b305d410758ff71b42c6 (diff)
Add predefined templates for task descriptions
Diffstat (limited to 'app/Validator')
-rw-r--r--app/Validator/PredefinedTaskDescriptionValidator.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/Validator/PredefinedTaskDescriptionValidator.php b/app/Validator/PredefinedTaskDescriptionValidator.php
new file mode 100644
index 00000000..3ff4e3cb
--- /dev/null
+++ b/app/Validator/PredefinedTaskDescriptionValidator.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Kanboard\Validator;
+
+use SimpleValidator\Validator;
+use SimpleValidator\Validators;
+
+class PredefinedTaskDescriptionValidator extends BaseValidator
+{
+ public function validate(array $values)
+ {
+ $v = new Validator($values, array(
+ new Validators\Required('title', t('This value is required')),
+ new Validators\Required('description', t('This value is required')),
+ ));
+
+ return array(
+ $v->execute(),
+ $v->getErrors()
+ );
+ }
+} \ No newline at end of file