prepareRevision example

/** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    $revisionId = $this->revision->getRevisionId();
    $revisionLabel = $this->revision->label();
    $bundleLabel = $this->getBundleLabel($this->revision);
    if ($this->revision instanceof RevisionLogInterface) {
      $originalRevisionTimestamp = $this->revision->getRevisionCreationTime();
    }

    $this->revision = $this->prepareRevision($this->revision, $form_state);

    if (isset($originalRevisionTimestamp)) {
      $date = $this->dateFormatter->format($originalRevisionTimestamp);
      $this->messenger->addMessage($this->t('@type %title has been reverted to the revision from %revision-date.', [
        '@type' => $bundleLabel,
        '%title' => $revisionLabel,
        '%revision-date' => $date,
      ]));
    }
    else {
      $this->messenger->addMessage($this->t('@type %title has been reverted.', [
        
Home | Imprint | This part of the site doesn't use cookies.