You are here

protected function ContentEntityForm::prepareEntity in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::prepareEntity()

Prepares the entity object before the form is built first.

Overrides EntityForm::prepareEntity

1 method overrides ContentEntityForm::prepareEntity()
EntityTestForm::prepareEntity in core/modules/system/tests/modules/entity_test/src/EntityTestForm.php
Prepares the entity object before the form is built first.

File

core/lib/Drupal/Core/Entity/ContentEntityForm.php, line 80

Class

ContentEntityForm
Entity form variant for content entity types.

Namespace

Drupal\Core\Entity

Code

protected function prepareEntity() {
  parent::prepareEntity();

  // Hide the current revision log message in UI.
  if ($this
    ->showRevisionUi() && !$this->entity
    ->isNew() && $this->entity instanceof RevisionLogInterface) {
    $this->entity
      ->setRevisionLogMessage(NULL);
  }
}