Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use field map in LocalgovDirectoriesEntryTypes::getReferenceableEntities() #365

Open
joachim-n opened this issue Mar 13, 2024 · 0 comments

Comments

@joachim-n
Copy link

LocalgovDirectoriesEntryTypes::getReferenceableEntities() returns those node types which have the 'localgov_directory_channels' field on them. It's doing this by looping over all node_type entities, and then getting ALL the fields on each node type.

This is fairly expensive. It's much easier to use EntityFieldManagerInterface::getFieldMap(). The list of node types that have the localgov_directory_channels field is then given by $field_map['node']['localgov_directory_channels']['bundles'].

(Though there is other brittleness here too -- filing an issue for that in a moment.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant