function ConfigTranslationFieldListBuilder::displayBundle

Same name in other branches
  1. 8.9.x core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php \Drupal\config_translation\Controller\ConfigTranslationFieldListBuilder::displayBundle()
  2. 10 core/modules/config_translation/src/Controller/ConfigTranslationFieldListBuilder.php \Drupal\config_translation\Controller\ConfigTranslationFieldListBuilder::displayBundle()
  3. 11.x 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 157

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.