Hi all,

I was wondering which is the right way to validate that an entity already
exists on the database on a relation between two entities. For example,
having these entities: Country and State. In the State entity, the country
is assigned to the $country attribute. Which would be the right way, in this
case, to validate that the Country assigned to the $country attribute
already exists on the database? I thought that it would be using the Choice
constraint, but even using a callback I would need to pass to the State
entity the Country repository, which I don't think is the best way.

How do you guys validate entities in these cases?


Thanks in advance!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to