Is there a way to obtain a list of entity reference fields by field type (similar to that produced by
$ all_reference_fields = $ this-> entityFieldManager-> getFieldMapByFieldType (& # 39; entity_reference & # 39;);) but filtered to list only entity reference fields containing target entity types and sets corresponding to a specified list.
I do not see anything in entityFieldManager that would easily filter the results of the
getFieldMap () or
getFieldMapByFieldType () I am only looking for specific reference fields because the mapping does not contain any storage information in the field, which contains the list of target sets and managers.
Looks like the entity_reference module in the kernel does not provide any service that would be logical place for something like this, so I currently think I'll have to do it in two steps:
getFieldMapByFieldType (& # 39; entity_reference & # 39;);.
- Browse each type of entity in the field map and call
buildFieldStorageDefinitions ($ entity_type);or something of that nature, to understand the target
entity_type: file_namecombinations, and hunt down the fields that reference
& # 39; taxonomy_term: tag & # 39;. This seems horribly inefficient, because of the large number of entity_reference fields on this site, so maybe there is a better way to do this step?
In an ideal world, there would be only a set of database calls that I could perform, or even a service at the heart of the entity_reference module! (wishful thinking);)