You are here

public function BundleConfigManager::setEnabled in Title 8.2

Set the enabled/disabled status of a bundle.

Parameters

string|object $bundle: The bundle name or object to manipulate.

boolean $value: The value of set.

File

src/BundleConfigManager.php, line 27

Class

BundleConfigManager
Allow management of the title module config.

Namespace

Drupal\title

Code

public function setEnabled($bundle, $value) {

  // In the #entity_builders function, no values can be saved against a bundle
  // which doesn't originate from the hook's paramaters. Support bundle names
  // or passed in NodeType objects as a result.
  if (is_string($bundle)) {
    $bundle = $this
      ->loadBundle($bundle);
  }
  $bundle
    ->setThirdPartySetting('title', 'display_configurable_title', $value);
  $bundle
    ->save();
}