Documentation

DeleteGuideForm extends FormBase
in package

Provides a form to confirm and delete a guide.

This form is used to delete a guide and its directly owned pages and boxes from the system. It provides a confirmation step to prevent accidental deletions. It does not delete links to pages and boxes owned by other pages or guides, nor does it delete content items associated with those pages or boxes.

Table of Contents

Methods

access()  : AccessResult
Checks if the user can edit their own article.
buildForm()  : array<string|int, mixed>
Builds the guide deletion confirmation form.
getFormId()  : string
{@inheritdoc}
submitForm()  : void
Handles the submission of the guide deletion form.

Methods

access()

Checks if the user can edit their own article.

public access(Request $request, AccountInterface $account) : AccessResult
Parameters
$request : Request
$account : AccountInterface
Return values
AccessResult

buildForm()

Builds the guide deletion confirmation form.

public buildForm(array<string|int, mixed> $form, FormStateInterface $form_state) : array<string|int, mixed>
Parameters
$form : array<string|int, mixed>

An associative array containing the structure of the form.

$form_state : FormStateInterface

The current state of the form.

Return values
array<string|int, mixed>

The form structure, including a warning message and a deletion confirmation checkbox.

getFormId()

{@inheritdoc}

public getFormId() : string
Return values
string

submitForm()

Handles the submission of the guide deletion form.

public submitForm(array<string|int, mixed> &$form, FormStateInterface $form_state) : void

Executes the deletion of the specified guide, including any pages and boxes it directly owns, based on user confirmation. It ensures the guide is properly removed from the system, then redirects the user to a safe location, typically the dashboard overview page.

Parameters
$form : array<string|int, mixed>

The form array.

$form_state : FormStateInterface

The state of the form.


        
On this page

Search results