public function TestEntityFormController::form

Overrides Drupal\Core\Entity\EntityFormController::form().

Overrides EntityFormController::form

File

drupal/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityFormController.php, line 20
Definition of Drupal\field_test\TestEntityFormController.

Class

TestEntityFormController
Form controller for the test entity edit forms.

Namespace

Drupal\field_test

Code

public function form(array $form, array &$form_state) {
  $form = parent::form($form, $form_state);
  $entity = $this->entity;
  if (!$entity
    ->isNew()) {
    $form['revision'] = array(
      '#access' => user_access('administer field_test content'),
      '#type' => 'checkbox',
      '#title' => t('Create new revision'),
      '#default_value' => FALSE,
      '#weight' => 100,
    );
  }
  return $form;
}