You are here

protected function SearchApiEntity::getDisplayMethod in Search API 8

Retrieves the display method configured for a certain bundle.

Parameters

string $bundle: The bundle of the entity being displayed.

Return value

string|null The "display_method" option selected for this bundle, or NULL if none was selected yet.

3 calls to SearchApiEntity::getDisplayMethod()
SearchApiEntity::buildOptionsForm in src/Plugin/views/field/SearchApiEntity.php
Provide a form to edit options for this plugin.
SearchApiEntity::getItem in src/Plugin/views/field/SearchApiEntity.php
Creates an item for the given entity.
SearchApiEntity::preRender in src/Plugin/views/field/SearchApiEntity.php
Runs before any fields are rendered.

File

src/Plugin/views/field/SearchApiEntity.php, line 340

Class

SearchApiEntity
Handles the display of entity reference fields in Search API Views.

Namespace

Drupal\search_api\Plugin\views\field

Code

protected function getDisplayMethod($bundle) {
  return $this->options['display_methods'][$bundle]['display_method'] ?? NULL;
}