You are here

public function BundleConfigManager::tearDownBundleState in Title 8.2

Hide the title on all view modes when of a bundle when disabling.

Parameters

$bundle: The bundle to disable the title field for.

File

src/BundleConfigManager.php, line 127

Class

BundleConfigManager
Allow management of the title module config.

Namespace

Drupal\title

Code

public function tearDownBundleState($bundle) {
  foreach ($this
    ->getViewModeIds('node') as $view_mode) {

    // This is the default state of the title field defined in
    // Node::baseFieldDefinitions(). Matching the default state is required
    // for things like the page title.
    $this
      ->setTitleRegion($bundle, $view_mode, TITLE_DISPLAY_REGION_ENABLED);
    $this
      ->setTitleFieldFormatter($bundle, $view_mode, 'string', []);
  }
}