public function LicenseCheckoutForm::buildForm in Commerce License 8.2
Form constructor.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form structure.
Overrides EntityForm::buildForm
File
- src/
Form/ LicenseCheckoutForm.php, line 18
Class
- LicenseCheckoutForm
- Form controller for License edit forms.
Namespace
Drupal\commerce_license\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
/* @var $entity \Drupal\commerce_license\Entity\License */
$form = parent::buildForm($form, $form_state);
if (!$this->entity
->isNew()) {
$form['new_revision'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Create new revision'),
'#default_value' => FALSE,
'#weight' => 10,
];
}
$this->entity
->getPlugin()
->buildCheckoutForm($form, $form_state);
$entity = $this->entity;
return $form;
}