You are here

public function ViewMode::isOverridden in Search API Pages 8

Determines if a view mode is overridden for a given data source and bundle.

Parameters

string $dataSourceId: The data source id.

string $bundleId: The bundle id.

Return value

bool True if the bundle is overridden, false if it is not.

Overrides ViewModeConfigInterface::isOverridden

1 call to ViewMode::isOverridden()
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 82

Class

ViewMode
Value object for view mode configuration.

Namespace

Drupal\search_api_page\Config

Code

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