I have the following scenario:
- My project has an
AppBundle
with aUser
entity. - Other bundles add more entities like
Address
,Todo
,Project
,WhatEver
. - Those entities must belong to a
User
so that I can call$user->getAddresses()
,$user->getTodos()
,$user->addProject()
,$user->setWhatEvers()
. - Those bundles must remain "pluggable" so the
User
entity doesn't necessarily know about them and I can't add those properties liketodos
and its getters/setters directly into theUser
entity.
I thought about reflection, magic getters/setters, traits as possible aproaches but nothing really fits my needs. Any ideas on how to achieve this?
Aucun commentaire:
Enregistrer un commentaire