I have a basic domain object, say like Person or Campaign or Event that is represented by a single table in the database. However, I also have more complicated versions of these objects say like a PersonCampaign or PersonEvent or even CampaignEvent that could theoretically extend one of the base objects.
However, for a number of reasons this becomes complicated because PHP does not support multiple inheritance (for example does PersonEvent extend Person or Event). And also because some domain objects are actually factory objects with varying properties and functionality (for example Event is actually subclassed by the type of event like email, call, fax).
The easiest solution that I can see is to have the actual nature of the object change based on what data is returned from the data access layer.
Does anyone have any suggestions on a better way to handle this? Or is it correct to create unified domain objects that can change properties and behavior based on what is currently available to it from the data access layer?