protected function DomainCommands::ensureEntityFieldMap in Domain Access 8
Ensure the local entity field map has been defined.
Asking for the entity field map cause a lot of lookup, so we lazily fetch it and then remember it to avoid repeated checks.
3 calls to DomainCommands::ensureEntityFieldMap()
- DomainCommands::entityHasDomainField in domain/
src/ Commands/ DomainCommands.php - Determines whether or not a given entity is domain-enabled.
- DomainCommands::findDomainEnabledEntities in domain/
src/ Commands/ DomainCommands.php - Returns a list of the entity types that are domain enabled.
- DomainCommands::getFieldEntities in domain/
src/ Commands/ DomainCommands.php - Finds entities that reference a specific field.
File
- domain/
src/ Commands/ DomainCommands.php, line 1223
Class
- DomainCommands
- Drush commands for the domain module.
Namespace
Drupal\domain\CommandsCode
protected function ensureEntityFieldMap() {
// Try to avoid repeated calls to getFieldMap() assuming it's expensive.
if (empty($this->entityFieldMap)) {
$entity_field_manager = \Drupal::service('entity_field.manager');
$this->entityFieldMap = $entity_field_manager
->getFieldMap();
}
}