updateChangedTime example



    return $form;
  }

  /** * {@inheritdoc} */
  public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form$form_state);
    // Update the changed timestamp of the entity.     $this->updateChangedTime($this->entity);
  }

  /** * {@inheritdoc} */
  public function buildEntity(array $form, FormStateInterface $form_state) {
    /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */
    $entity = parent::buildEntity($form$form_state);

    // Mark the entity as requiring validation.     $entity->setValidationRequired(!$form_state->getTemporaryValue('entity_validated'));

    
Home | Imprint | This part of the site doesn't use cookies.