You are here

public function EntityHelper::getBundleEntityTypeId in Simple XML sitemap 8.2

Same name and namespace in other branches
  1. 8.3 src/EntityHelper.php \Drupal\simple_sitemap\EntityHelper::getBundleEntityTypeId()

Gets the entity type id for a bundle.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

Return value

null|string

File

src/EntityHelper.php, line 55

Class

EntityHelper
Class EntityHelper @package Drupal\simple_sitemap

Namespace

Drupal\simple_sitemap

Code

public function getBundleEntityTypeId(EntityInterface $entity) {
  return $entity
    ->getEntityTypeId() === 'menu' ? 'menu_link_content' : $entity
    ->getEntityType()
    ->getBundleOf();
}