3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00
farmOS/modules/core/quick/src/Plugin/QuickForm/QuickFormInterface.php

98 lines
2.2 KiB
PHP
Raw Normal View History

2021-07-15 20:55:12 +02:00
<?php
namespace Drupal\farm_quick\Plugin\QuickForm;
2021-07-15 20:55:12 +02:00
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Session\AccountInterface;
2021-07-15 20:55:12 +02:00
/**
* Interface for quick forms.
*/
interface QuickFormInterface {
2021-07-15 20:55:12 +02:00
/**
* Returns the quick form ID.
*
* @return string
* The quick form ID.
*/
public function getId();
/**
* Returns the quick form label.
*
* @return string
* The quick form label.
*/
public function getLabel();
/**
* Returns the quick form description.
*
* @return string
* The quick form description.
*/
public function getDescription();
/**
* Returns the quick form help text.
*
* @return string
* The quick form help text.
*/
public function getHelpText();
/**
* Returns the list of access permissions for the quick form.
*
* @return string[]
* An array of permission strings.
*/
public function getPermissions();
/**
* Checks access for the quick form.
*
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access(AccountInterface $account);
2021-07-15 20:55:12 +02:00
/**
* Form constructor.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*
* @return array
* The form structure.
*/
public function buildForm(array $form, FormStateInterface $form_state);
/**
* Form validation handler.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
public function validateForm(array &$form, FormStateInterface $form_state);
/**
* Form submission handler.
*
* @param array $form
* An associative array containing the structure of the form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
*/
public function submitForm(array &$form, FormStateInterface $form_state);
}