function ContentEntityForm::prepareEntity

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::prepareEntity()
  2. 10 core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::prepareEntity()
  3. 11.x core/lib/Drupal/Core/Entity/ContentEntityForm.php \Drupal\Core\Entity\ContentEntityForm::prepareEntity()

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 76

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);
    }
}

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