public function EntityHelper::getEntityInstanceBundleName in Simple XML sitemap 8.2
Same name and namespace in other branches
- 8.3 src/EntityHelper.php \Drupal\simple_sitemap\EntityHelper::getEntityInstanceBundleName()
Gets an entity's bundle name.
Parameters
\Drupal\Core\Entity\EntityInterface $entity:
Return value
string
File
- src/
EntityHelper.php, line 43
Class
- EntityHelper
- Class EntityHelper @package Drupal\simple_sitemap
Namespace
Drupal\simple_sitemapCode
public function getEntityInstanceBundleName(EntityInterface $entity) {
return $entity
->getEntityTypeId() === 'menu_link_content' ? $entity
->getMenuName() : $entity
->bundle();
}