public function BackgroundImageManager::getEnabledEntityTypes in Background Image 8
Same name and namespace in other branches
- 2.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getEnabledEntityTypes()
- 2.0.x src/BackgroundImageManager.php \Drupal\background_image\BackgroundImageManager::getEnabledEntityTypes()
Retrieves the enabled entity types.
Return value
\Drupal\Core\Entity\EntityTypeInterface[] An associative array of EntityTypeInterface objects, keyed by their machine name.
Overrides BackgroundImageManagerInterface::getEnabledEntityTypes
1 call to BackgroundImageManager::getEnabledEntityTypes()
- BackgroundImageManager::validEntity in src/
BackgroundImageManager.php - Checks whether an entity can use background images.
File
- src/
BackgroundImageManager.php, line 394
Class
Namespace
Drupal\background_imageCode
public function getEnabledEntityTypes() {
$supported = $this
->getSupportedEntityTypes();
$enabled = [];
foreach ($supported as $entity_type) {
if (array_filter($this
->getEnabledEntityTypeBundles($entity_type))) {
$enabled[$entity_type
->id()] = TRUE;
}
}
return array_intersect_key($supported, $enabled);
}