You are here

public function Delete::buildForm in SimpleAds 8

Same name in this branch
  1. 8 src/Form/Groups/Delete.php \Drupal\simpleads\Form\Groups\Delete::buildForm()
  2. 8 src/Form/Ads/Delete.php \Drupal\simpleads\Form\Ads\Delete::buildForm()
  3. 8 src/Form/Campaigns/Delete.php \Drupal\simpleads\Form\Campaigns\Delete::buildForm()

Parameters

int $form_id: (optional) The ID of the item to be deleted.

Overrides ConfirmFormBase::buildForm

File

src/Form/Campaigns/Delete.php, line 65

Class

Delete
Delete advertisement campaign form.

Namespace

Drupal\simpleads\Form\Campaigns

Code

public function buildForm(array $form, FormStateInterface $form_state, $type = NULL, $id = NULL) {
  $form['campaign_type'] = [
    '#type' => 'hidden',
    '#value' => $type,
  ];
  $form['id'] = [
    '#type' => 'hidden',
    '#value' => $id,
  ];
  $this->campaign = (new Campaigns())
    ->setId($id)
    ->load();
  return parent::buildForm($form, $form_state);
}