- 🇬🇧United Kingdom joachim
I think there's a simpler way to do this. Maybe it wasn't available when the patch here was originally made, but every field handler on a view knows which relationship its on, and the result row object has the entity for each relationship.
This is code from Entity Pager module for doing the same sort of thing:
protected function getResultEntity(ResultRow $row) { return $this->options['relationship'] ? $row->_relationship_entities[$this->options['relationship']] : $row->_entity; }
$this->options['relationship'] will need tweaking, as Entity Pager uses its own option definition for that.
- 🇨🇭Switzerland berdir Switzerland
This is for the file usage table, which has an type and id column. That's not a relationship and can't be expressed as a relationship because every column can be a different entity type.