You are here

protected function DomainCommands::entityHasDomainField in Domain Access 8

Determines whether or not a given entity is domain-enabled.

Parameters

string $entity_type: The machine name of the entity.

string $field: The name of the field to check for existence.

Return value

bool True if this type of entity has a domain field.

1 call to DomainCommands::entityHasDomainField()
DomainCommands::enumerateDomainEntities in domain/src/Commands/DomainCommands.php
Enumerate entity instances of the supplied type and domain.

File

domain/src/Commands/DomainCommands.php, line 1211

Class

DomainCommands
Drush commands for the domain module.

Namespace

Drupal\domain\Commands

Code

protected function entityHasDomainField($entity_type, $field = DomainInterface::DOMAIN_ADMIN_FIELD) {

  // Try to avoid repeated calls to getFieldMap(), assuming it's expensive.
  $this
    ->ensureEntityFieldMap();
  return array_key_exists($field, $this->entityFieldMap[$entity_type]);
}