public function EntityHelper::supports in Simple XML sitemap 4.x
Determines if an entity type is supported or not.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type:
Return value
bool TRUE if entity type is supported, FALSE if not.
File
- src/
Entity/ EntityHelper.php, line 114
Class
- EntityHelper
- Helper class for working with entities.
Namespace
Drupal\simple_sitemap\EntityCode
public function supports(EntityTypeInterface $entity_type) : bool {
if (!$entity_type instanceof ContentEntityTypeInterface || !method_exists($entity_type, 'getBundleEntityType') || !$entity_type
->hasLinkTemplate('canonical')) {
return FALSE;
}
return TRUE;
}