You are here

public function EntityHelper::supports in Simple XML sitemap 8.3

Determines if an entity type is supported or not.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type:

Return value

bool TRUE if entity type supported by Simple Sitemap, FALSE if not.

File

src/EntityHelper.php, line 117

Class

EntityHelper
Helper class for working with entities.

Namespace

Drupal\simple_sitemap

Code

public function supports(EntityTypeInterface $entity_type) {
  if (!$entity_type instanceof ContentEntityTypeInterface || !method_exists($entity_type, 'getBundleEntityType') || !$entity_type
    ->hasLinkTemplate('canonical')) {
    return FALSE;
  }
  return TRUE;
}