You are here

public function ViewMode::hasOverrides in Search API Pages 8

Determines if the given data source has any view mode overrides.

Parameters

string $dataSourceId: The data source id.

Return value

bool True if any overrides are present, false if there are not.

Overrides ViewModeConfigInterface::hasOverrides

2 calls to ViewMode::hasOverrides()
ViewMode::getViewMode in src/Config/ViewMode.php
Gets the configured view mode for a given data source and bundle.
ViewMode::isOverridden in src/Config/ViewMode.php
Determines if a view mode is overridden for a given data source and bundle.

File

src/Config/ViewMode.php, line 63

Class

ViewMode
Value object for view mode configuration.

Namespace

Drupal\search_api_page\Config

Code

public function hasOverrides($dataSourceId) {
  if (!isset($this->rawConfig[$dataSourceId]['overrides'])) {
    return FALSE;
  }
  if (empty($this->rawConfig[$dataSourceId]['overrides'])) {
    return FALSE;
  }
  if (empty(array_filter($this->rawConfig[$dataSourceId]['overrides']))) {
    return FALSE;
  }
  return TRUE;
}