You are here

public function FlagConfirmFormBase::buildForm in Flag 8.4

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 ConfirmFormBase::buildForm

File

src/Form/FlagConfirmFormBase.php, line 33

Class

FlagConfirmFormBase
Provides methods common to the flag and unflag confirm forms.

Namespace

Drupal\flag\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, FlagInterface $flag = NULL, $entity_id = NULL) {
  $this->flag = $flag;
  $flag_service = \Drupal::service('flag');
  $this->entity = $flag_service
    ->getFlaggableById($this->flag, $entity_id);
  return parent::buildForm($form, $form_state);
}