FWIW I advice against using form and input filter annotations in doctrine
entities.

While it may be handy for rapid and simple prototyping, it has been stated
many many times that doctrine entities are dumb value objects, and they
should not be concerned with anything other than themselves. This is a
strong design nuance that is often not given the importance it deserves.
Using annotations inside entities to build forms and input filters is
actually obfuscating business logic, inside something that should not be
aware of any logic whatsoever in the first place.
Furthermore, you'll find that such annotations are limited in flexibility
(e.g. objects needing concrete dependencies in their options like
doctrine's ObjectSelect).
The only annotations I consistently use are the doctrine mappings for DDL,
which is the only thing entities *could* be concerned with, but even that
is arguable and may end up being inconvenient in some cases.

TL;DR: write separate classes for all your forms/fieldsets/filters. Leave
the annotations for DDL mappings only.

Reply via email to