I developed custom entities in the code, using entity references : A <- R -> C. Entity "R" contains references to "A" and "B".
I'd like to add a pseudo-field in entity "A", configurable in view display, that could render referencing entities (mean "R" entities referencing "A" with a given field "F").
Since I made my own classes for the entities, I'd really like to continue that way and prevent using hooks. I know I could achieve this with views, but it seems more logical, reusable, and quicker, to put it in entity code.
Is there a way to add the display field to my entity without using hook_entity_extra_field_info() ? For example could I create my own FieldEntityManager ?
Is EntityViewBuilder the right place to render the field with my own data ?
In a more generic way, would it be possible to develop a custom field type "referencing_entities" that I could reuse in every referenced entities I have ? Would it be only a field formatter since I don't need to store anything ? Is it possible to access to the entity from the field to query referencing entities ?