You are here

public function EntityManager::bundleIsIndexed in Simple XML sitemap 4.x

Checks if an entity bundle (or a non-bundle entity type) is set to be indexed for any of the currently set variants.

Parameters

string $entity_type_id:

string|null $bundle_name:

Return value

bool

File

src/Manager/EntityManager.php, line 478

Class

EntityManager
Class EntityManager

Namespace

Drupal\simple_sitemap\Manager

Code

public function bundleIsIndexed(string $entity_type_id, ?string $bundle_name = NULL) : bool {
  foreach ($this
    ->getBundleSettings($entity_type_id, $bundle_name, FALSE, TRUE) as $settings) {
    if (!empty($settings['index'])) {
      return TRUE;
    }
  }
  return FALSE;
}