You are here

private function SearchApiExcludeEntityProcessor::bundleHasField in Search API Exclude Entity 8

Checking if a specific entity bundle has a specific field.

Parameters

string $entity_type: Entity type we are using in the field check.

string $bundle: Bundle we are using in the field check.

string $field: The field we are checking if it is being used by the bundle.

Return value

bool TRUE if the entity bundle has the field, FALSE otherwise.

1 call to SearchApiExcludeEntityProcessor::bundleHasField()
SearchApiExcludeEntityProcessor::alterIndexedItems in src/Plugin/search_api/processor/SearchApiExcludeEntityProcessor.php
Alter the items to be indexed.

File

src/Plugin/search_api/processor/SearchApiExcludeEntityProcessor.php, line 165

Class

SearchApiExcludeEntityProcessor
Excludes entities marked as 'excluded' from being indexes.

Namespace

Drupal\search_api_exclude_entity\Plugin\search_api\processor

Code

private function bundleHasField($entity_type, $bundle, $field) {
  static $field_map;
  if (!isset($field_map)) {
    $field_map = $this
      ->getEntityFieldManager()
      ->getFieldMapByFieldType('search_api_exclude_entity');
  }
  return isset($field_map[$entity_type][$field]['bundles'][$bundle]);
}