You are here

public function ViewMode::getDefaultViewMode in Search API Pages 8

Gets the default view mode for a given data source.

Parameters

string $dataSourceId: The data source id.

Return value

string The view mode machine name.

Overrides ViewModeConfigInterface::getDefaultViewMode

1 call to ViewMode::getDefaultViewMode()
ViewMode::getViewMode in src/Config/ViewMode.php
Gets the configured view mode for a given data source and bundle.

File

src/Config/ViewMode.php, line 49

Class

ViewMode
Value object for view mode configuration.

Namespace

Drupal\search_api_page\Config

Code

public function getDefaultViewMode($dataSourceId) {
  if (!isset($this->rawConfig[$dataSourceId]['default'])) {
    return self::DEFAULT_VIEW_MODE;
  }
  if (empty($this->rawConfig[$dataSourceId]['default'])) {
    return self::DEFAULT_VIEW_MODE;
  }
  return $this->rawConfig[$dataSourceId]['default'];
}