function ContentEntityBase::setDefaultTranslationEnforced

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::setDefaultTranslationEnforced()

Set or clear an override of the isDefaultTranslation() result.

Parameters

bool|null $enforce_default_translation: If boolean value is passed, the value will override the result of isDefaultTranslation() method. If NULL is passed, the default logic will be used.

Return value

$this

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 434

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function setDefaultTranslationEnforced(?bool $enforce_default_translation) : static {
    $this->enforceDefaultTranslation = $enforce_default_translation;
    return $this;
}

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