[FLOW3-general] Validation: I'm always having validation errors twice
Alexander Schnitzler
mail at alexanderschnitzler.de
Fri Oct 14 09:22:52 CEST 2011
Yeah, YMMD!
> * Domain Model validators. If, for model \Foo\Bar\Domain\Model\Baz, a
> validator named \Foo\Bar\Domain\Validator\BazValidator exists, it is
> *automatically called*
Actually, this is absolutely great though I highly recommend to point
that out in the manual. :)
Am 14.10.2011 08:23, schrieb Sebastian Kurfürst:
> Hey Alexander,
>
>>> /**
>>> * @param \Acme\Users\Domain\Model\Registration $registration
>>> * @return void
>>> * @validate $registration
>>> \Acme\Users\Domain\Validator\RegistrationValidator
>>> */
>>> public function
>>> createAccountAction(\Acme\Users\Domain\Model\Registration
>>> $registration) {
>>>
>>> }
>>
>> Actually I don't know whether the newAccountAction has to be given the
>> object aka null but it works. So I do not think that's part of the
>> mistake.
> You don't need that; but there is still a bug in this area which we plan
> to correct with 1.0 final. However, this is not related to your issue.
>
> Validators are collected from three sources:
>
> * @validate annotations in the model
> * Domain Model validators. If, for model \Foo\Bar\Domain\Model\Baz, a
> validator named \Foo\Bar\Domain\Validator\BazValidator exists, it is
> *automatically called*
> * @validate annotations in the *controller action*
>
>
> So, as you adhere to the convention for domain model validators, you do
> *not* need to specify it explicitely in the @validate annotation :-)
>
> Greets,
> Sebastian
More information about the FLOW3-general
mailing list