From: Christian Weiske Date: Tue, 5 Dec 2017 15:13:25 +0000 (+0100) Subject: (no commit message) X-Git-Url: https://git.cweiske.de/paste/525.git/commitdiff_plain/HEAD?ds=inline --- fb8c922b7d397ce17e5e0aad69a9de0c73e53427 diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..1f80d24 --- /dev/null +++ b/README.rst @@ -0,0 +1,3 @@ +https://noctus.net/2011/extbase-model-zugriff-in-validatoren is outdated. + +Solution: use forProperty() \ No newline at end of file diff --git a/RequestValidator.php b/RequestValidator.php new file mode 100644 index 0000000..4bc4577 --- /dev/null +++ b/RequestValidator.php @@ -0,0 +1,23 @@ +foo == 5 && $req->bar == '') { + //require $bar only when $foo is 5 + $this->result->forProperty('bar')->addError( + new \TYPO3\CMS\Extbase\Validation\Error( + $this->translateErrorMessage( + 'validator.notempty.empty', + 'extbase' + ), + 1221560910 + ) + ); + } + } +} +?>