You are here

public function PhotosImageDeleteForm::buildForm in Album Photos 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.

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

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

src/Form/PhotosImageDeleteForm.php, line 109

Class

PhotosImageDeleteForm
Defines a confirmation form for deleting images.

Namespace

Drupal\photos\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $file = '') {

  // @todo update access!
  $this->id = $file;
  if (!$this->id) {
    throw new NotFoundHttpException();
  }

  // @todo set album type?
  return parent::buildForm($form, $form_state);
}