class FormAjaxException in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Form/FormAjaxException.php \Drupal\Core\Form\FormAjaxException
Custom exception to break out of AJAX form processing.
Hierarchy
- class \Drupal\Core\Form\FormAjaxException extends \Drupal\Core\Form\Exception
Expanded class hierarchy of FormAjaxException
2 files declare their use of FormAjaxException
- FormAjaxSubscriber.php in core/
lib/ Drupal/ Core/ Form/ EventSubscriber/ FormAjaxSubscriber.php - Contains \Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber.
- FormAjaxSubscriberTest.php in core/
tests/ Drupal/ Tests/ Core/ Form/ EventSubscriber/ FormAjaxSubscriberTest.php - Contains \Drupal\Tests\Core\Form\EventSubscriber\FormAjaxSubscriberTest.
File
- core/
lib/ Drupal/ Core/ Form/ FormAjaxException.php, line 13 - Contains \Drupal\Core\Form\FormAjaxException.
Namespace
Drupal\Core\FormView source
class FormAjaxException extends \Exception {
/**
* The form definition.
*
* @var array
*/
protected $form;
/**
* The form state.
*
* @var \Drupal\Core\Form\FormStateInterface
*/
protected $formState;
/**
* Constructs a FormAjaxException object.
*
* @param array $form
* The form definition.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state.
* @param string $message
* (optional) The exception message.
* @param int $code
* (optional) A user defined exception code.
* @param \Exception $previous
* (optional) The previous exception for nested exceptions.
*/
public function __construct(array $form, FormStateInterface $form_state, $message = "", $code = 0, \Exception $previous = NULL) {
parent::__construct($message, $code, $previous);
$this->form = $form;
$this->formState = $form_state;
}
/**
* Gets the form definition.
*
* @return array
* The form structure.
*/
public function getForm() {
return $this->form;
}
/**
* Gets the form state.
*
* @return \Drupal\Core\Form\FormStateInterface
* The current state of the form.
*/
public function getFormState() {
return $this->formState;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FormAjaxException:: |
protected | property | The form definition. | |
FormAjaxException:: |
protected | property | The form state. | |
FormAjaxException:: |
public | function | Gets the form definition. | |
FormAjaxException:: |
public | function | Gets the form state. | |
FormAjaxException:: |
public | function | Constructs a FormAjaxException object. |