You are here

public function ConfigTranslationFieldListBuilder::displayBundle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php \Drupal\config_translation\Controller\ConfigTranslationFieldListBuilder::displayBundle()

Controls the visibility of the bundle column on field list pages.

Return value

bool Whenever the bundle is displayed or not.

2 calls to ConfigTranslationFieldListBuilder::displayBundle()
ConfigTranslationFieldListBuilder::buildHeader in core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php
Builds the header row for the entity listing.
ConfigTranslationFieldListBuilder::buildRow in core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php
Builds a row for an entity in the entity listing.

File

core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php, line 150
Contains \Drupal\config_translation\Controller\ConfigTranslationFieldListBuilder.

Class

ConfigTranslationFieldListBuilder
Defines the config translation list builder for field entities.

Namespace

Drupal\config_translation\Controller

Code

public function displayBundle() {

  // The bundle key is explicitly defined in the entity definition.
  if ($this->baseEntityInfo
    ->getKey('bundle')) {
    return TRUE;
  }

  // There is more than one bundle defined.
  if (count($this->baseEntityBundles) > 1) {
    return TRUE;
  }

  // The defined bundle ones not match the entity type name.
  if (!empty($this->baseEntityBundles) && !isset($this->baseEntityBundles[$this->baseEntityType])) {
    return TRUE;
  }
  return FALSE;
}