W3cubDocs

/Drupal 8

protected function FormAjaxSubscriber::getFormAjaxException

protected FormAjaxSubscriber::getFormAjaxException(\Exception $e)

Extracts a form AJAX exception.

Parameters

\Exception $e: A generic exception that might contain a form AJAX exception.

Return value

\Drupal\Core\Form\FormAjaxException|null Either the form AJAX exception, or NULL if none could be found.

File

core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php, line 121

Class

FormAjaxSubscriber
Wraps AJAX form submissions that are triggered via an exception.

Namespace

Drupal\Core\Form\EventSubscriber

Code

protected function getFormAjaxException(\Exception $e) {
  $exception = NULL;
  while ($e) {
    if ($e instanceof FormAjaxException) {
      $exception = $e;
      break;
    }

    $e = $e->getPrevious();
  }
  return $exception;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!EventSubscriber!FormAjaxSubscriber.php/function/FormAjaxSubscriber::getFormAjaxException/8.1.x