[Flow] Using aspects to change EmailAddressValidator

Steffen Wickham steffen at gaming-inc.de
Mon Jan 6 12:00:46 CET 2014


Hello Bastian,

I aggree to achieve my changes in a clean way, but I can't afford it by 
my own atm. Using AOP doesn't work for me (and I still don't know why), 
using annotations is not suitable for me as the validator is called by 
TYPO3.Party package and therefore also 3rd party code and the total 
replacement of original implementations by using Objects.yaml does work 
on interfaces only. :-/

So I'm totally stuck. I even had a look in Neos code which does rely on 
AOP in many ways but can't figure out why their code work and mine not. :-(

Greetings
Steffen



Am 06.01.14 10:36, schrieb Bastian Waidelich:
> Pankaj Lele wrote:
>
> Hi Steffen & Pankaj,
>
>> If you want a different EmailAddressValidator then instead of 
>> changing the existing EmailAddressValidator
>> using AOP you can develop a new validator itself and use it directly. 
>> This would be a clean way.
>
> +1
>
> You can extend the original EmailAddressValidator[1] to 
> \Your\Package\Validation\Validator\EmailAddressValidator, override its 
> validEmail() method and refer to it via:
>
> @Flow\Validate(type="Your.Package:EmailAddress")
>
> If you want to change the behavior for 3rd party code you should be 
> able to replace the original implementation via Objects.yaml.
>
>
>> Happy New Year!
>
> +2 ;)
>
>
> [1] 
> https://git.typo3.org/Packages/TYPO3.Flow.git/blob/HEAD:/Classes/TYPO3/Flow/Validation/Validator/EmailAddressValidator.php
>
>



More information about the Flow mailing list