1. You have a child object Y which can have more than one type of parent object (X, W. V)
2. you want to be able to see all related Y in a portal on XDetailsAndRelationsView
Currently appears to require manually coding a view , otherwise breaks with "undfined index" when rendering view based on XsForWRelatedListView
When you declare a relation like this in X, W, or V:
$globalMetadata ... 'relations' => array( 'myYthngs' => array(RedBeanModel::HAS_MANY, 'Y', RedBeanModel::OWNED, LINK_TYPE_POLYMORPHIC, 'relatedModel'), ), ...
This will create two new columns in the Y table in the database:
But if you try to clone any ...RelatedListView , such as "OpportunitiesForAccountRelatedListView" .. you won't be able to render the view,,, even if you override RelatedListView::getDataProvider().
This seems to be b/c the current implementation is looking for a relation column for X, in the Y table. This won't exist. b/c we set the link type to poly in the relation. Currently in Comments/Missions modules for example, I see that entire view is created from scratch, and where clause is set independently (possibly to avoid using) dataProvider mechanism.
There should be support in the core so that we can leverage the existing view rendering architecture to create related list views, for polymorphic relations. rather than have to re-write views from scratch.
Would like to learn more about how this mechanism works, and which files to override to be able to use the ...RelatedListView views with poly type relations.
If we can set up a dev session for this topic to get some guidance, I would be willing to contribute to coding the solution. I think the session could be helpful to developers who need a better understanding of the RB models and views interact.