BlockContentForm::prepareEntity

protected BlockContentForm::prepareEntity()

Overrides \Drupal\Core\Entity\EntityForm::prepareEntity().

Prepares the custom block object.

Fills in a few default values, and then invokes hook_block_content_prepare() on all modules.

Overrides EntityForm::prepareEntity

File

core/modules/block_content/src/BlockContentForm.php, line 86

Class

BlockContentForm
Form handler for the custom block edit forms.

Namespace

Drupal\block_content

Code

protected function prepareEntity() {
  $block = $this->entity;
  // Set up default values, if required.
  $block_type = $this->blockContentTypeStorage->load($block->bundle());
  if (!$block->isNew()) {
    $block->setRevisionLogMessage(NULL);
  }
  // Always use the default revision setting.
  $block->setNewRevision($block_type->shouldCreateNewRevision());
}
doc_Drupal
2016-10-29 08:46:56
Comments
Leave a Comment

Please login to continue.