// Set $entityFieldManager before calling the parent constructor because the
// constructor will call init() which then calls setComponent() which needs
// $entityFieldManager.
$this->entityFieldManager = \Drupal::
service('entity_field.manager'
);
parent::
__construct($values,
$entity_type);
} /**
* {@inheritdoc}
*/
public function isOverridable() { return $this->
isLayoutBuilderEnabled() &&
$this->
getThirdPartySetting('layout_builder', 'allow_custom', FALSE
);
} /**
* {@inheritdoc}
*/
public function setOverridable($overridable = TRUE
) { $this->
setThirdPartySetting('layout_builder', 'allow_custom',
$overridable);
// Enable Layout Builder if it's not already enabled and overriding.
if ($overridable && !
$this->
isLayoutBuilderEnabled()) { $this->
enableLayoutBuilder();
}