project has lots of asset, an asset belongs to a group. then we have 3 content types
Project, ProjectAsset, AssetGroup
store the assets relation in Project content type.
Project
name assets relation
ProjectAsset
image group relation
Group
name
with this approach, we need to upload project asset first, then add this relation to project.
Store relation in ProjectAsset itself.
Project
name
ProjectAsset
image group relation project simple relation to project.
Group
name
with this approach, we specity relations(project, group relation) when we upload project asset.
what I want to do
when delete project, the project asset should be deleted as well. does ezplatform support embed association like doctrine orm?
when query project, I also need to get the project assets. what is the efficient way to do this? the
query
might be for a single project or a lists of project.
Hi "out of the box" it's not possible but of course there is a solution for that. It requires some developpement though What I would do is add an EventListener (or EventSubscriber) plugged on specific object type deletion so it triggers the appropriate deletions of related objects.
https://symfony.com/doc/current/event_dispatcher.html