function LayoutBuilderEntityViewDisplay::createCopy
Overrides EntityDisplayBase::createCopy
File
- 
              core/modules/ layout_builder/ src/ Entity/ LayoutBuilderEntityViewDisplay.php, line 253 
Class
- LayoutBuilderEntityViewDisplay
- Provides an entity view display entity that has a layout.
Namespace
Drupal\layout_builder\EntityCode
public function createCopy($mode) {
  // Disable Layout Builder and remove any sections copied from the original.
  return parent::createCopy($mode)->setSections([])
    ->disableLayoutBuilder();
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
