I have a class Foo (extending DataObject). A certain page type has_many Foo. I don't actually use objects of type Foo but only subtypes (inherited classes) RedFoo, BlueFoo and GreenFoo.
I want to have a DOM for each of these inherited Foo's ( DOM(RedFoo), DOM(BlueFoo), DOM(GreenFoo) ) but I don't want to have 3 has_many relations in the page. Is this possible?
I know you can pass a $sourceFilter to the constructor of the DOM so I could filter the specific Foo type I want for each DOM, but the DOM wouldn't be aware of what kind of Foo's he's managing. And it is important that each DOM know what kind of Foo he uses because they have different fields (e.g. one has an image field, another a text field).
The reason to have it this way is because in the frontend I want to treat all Foo's the same (with specific display mechanisms).