You are here

public function PromotionTranslationHandler::entityFormAlter in Commerce Core 8.2

Performs the needed alterations to the entity form.

Parameters

array $form: The entity form to be altered to provide the translation workflow.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\Core\Entity\EntityInterface $entity: The entity being created or edited.

Overrides ContentTranslationHandler::entityFormAlter

File

modules/promotion/src/PromotionTranslationHandler.php, line 17

Class

PromotionTranslationHandler
Defines the translation handler for promotions.

Namespace

Drupal\commerce_promotion

Code

public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
  parent::entityFormAlter($form, $form_state, $entity);
  if (isset($form['content_translation'])) {
    $form['content_translation']['status']['#access'] = FALSE;
    $form['content_translation']['uid']['#access'] = FALSE;
    $form['content_translation']['created']['#access'] = FALSE;
  }
}