You are here

protected function SearchApiSortsUpdateBase::getEntityTypesFromClassProperty in Search API sorts 8

Get the entity types from the "$entityTypes" class property.

Return value

array An array of entity type IDs.

1 call to SearchApiSortsUpdateBase::getEntityTypesFromClassProperty()
SearchApiSortsUpdateBase::setUp in tests/src/Functional/Update/SearchApiSortsUpdateBase.php
Overrides WebTestBase::setUp() for update testing.

File

tests/src/Functional/Update/SearchApiSortsUpdateBase.php, line 62

Class

SearchApiSortsUpdateBase
Base class for search_api_sorts update tests.

Namespace

Drupal\Tests\search_api_sorts\Functional\Update

Code

protected function getEntityTypesFromClassProperty() {
  $entity_types = [];
  $class = get_class($this);
  while ($class) {
    if (property_exists($class, 'entityTypes')) {
      $entity_types = array_merge($entity_types, $class::$entityTypes);
    }
    $class = get_parent_class($class);
  }
  return array_unique($entity_types);
}