in one of my projekts i have a lot of tables.
Some of them are related to each other.
For example i have following entities:
product, productCategory, package, package_productCategory
An product can have one productCategory. An Package can contains multiple productCategories.
Now it's important to avoid dropping a productCategory, that's used in product or/and productCategories.
How would you do this? Should i use foreignKeys, or should i hook in the @deleting event from doctrine?