[Flow] Validation > Exception instead of going back to newAction

Axel Wüstemann awu at qbus.de
Fri Dec 6 11:15:06 CET 2013


Am 06.12.2013 11:03, schrieb Stephen Bungert:
>> My object hast a property date. In the form I need to split the
>> date into __date and __time.
>
> Maybe you can use javascript to combine the values from your date and
> time fields into one datetime value that your model needs? Then it
> would have the property and it could be validated.o

I even could avoid using Flow... ;=)

In principle it is a good idea, but doesn't conform to the idea of DDD 
where validation rules are business rules. That's why they should be 
placed in the domain models.

This was one reason for me to choose Flow. This project Im working on 
ports an old Zend Framework application from 2009, now to Flow.
>
>> The MVC base validate will not act, because ther is nor date
>> property to validate. So it comes to the persistence valitation
>> wich throws an exeption.
>
> Have you tried validating the whole object instead of just the
> properties? This is an annotation on the controller action not the
> model. maybe you could then use your buildDateTime method to make
> sure your model validates.

How to do this? I added my validation rules to the properties to be
validated and in case of the date property I run into this issue. What
other I could do?


More information about the Flow mailing list