This relationship handler in Entity module lets you limit a relationship by bundle.

Eg, you can go from orders to line items (but only shipping).

Unfortunately the UI needs a bit of work for entities that don't use an entity as their bundles (as with taxonomy or profile2).

Comments

rszrama’s picture

Status: Active » Closed (won't fix)

I don't think it's reasonable for us to change this in the core of Commerce 1.x, because it would potentially break any View that's been customized already. I can see this working fine in a contrib if people use it on new sites. For Commerce 2.x, we may not even have an Entity API dependency b/c of all the work going on in the core Entity system, so I'm just going to close this for now.

joachim’s picture

Status: Closed (won't fix) » Active

This would only be a change in hook_view_data(), not in any default views. Furthermore, the new handler would add some extra options, which if not set, would make it behave exactly like the current one.

Hence I don't think it would break anything -- uncustomized views will pick up the new handle. Customized views that still have this relationship will pick up the new handler. Both will behave the same way.

rszrama’s picture

Can you show me some example code, perhaps?