class WebformSubmissionAjaxResponse in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Ajax/WebformSubmissionAjaxResponse.php \Drupal\webform\Ajax\WebformSubmissionAjaxResponse
Custom JSON response object for an ajax webform submission response.
We use a special response object to be able to fire a proper alter hook.
Hierarchy
- class \Drupal\Core\Ajax\AjaxResponse extends \Symfony\Component\HttpFoundation\JsonResponse implements AttachmentsInterface uses AttachmentsTrait
- class \Drupal\webform\Ajax\WebformSubmissionAjaxResponse
Expanded class hierarchy of WebformSubmissionAjaxResponse
See also
https://www.linkedin.com/pulse/how-alter-ajax-commands-view-response-dru...
1 file declares its use of WebformSubmissionAjaxResponse
- WebformAjaxFormTrait.php in src/
Form/ WebformAjaxFormTrait.php
File
- src/
Ajax/ WebformSubmissionAjaxResponse.php, line 15
Namespace
Drupal\webform\AjaxView source
class WebformSubmissionAjaxResponse extends AjaxResponse {
/**
* The webform submission of this ajax request.
*
* @var \Drupal\webform\WebformSubmissionInterface
*/
protected $submission;
/**
* Sets the webform submission of this response.
*
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* The webform submission of this ajax request.
*/
public function setWebformSubmission(WebformSubmissionInterface $webform_submission) {
$this->submission = $webform_submission;
}
/**
* Gets the webform submission of this response.
*
* @return \Drupal\webform\WebformSubmissionInterface
* The webform submission of this ajax request.
*/
public function getWebformSubmission() {
return $this->submission;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AjaxResponse:: |
protected | property | The array of ajax commands. | |
AjaxResponse:: |
public | function | Add an AJAX command to the response. | |
AjaxResponse:: |
public | function | Gets all AJAX commands. | |
AttachmentsTrait:: |
protected | property | The attachments for this response. | |
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
AttachmentsTrait:: |
public | function | ||
WebformSubmissionAjaxResponse:: |
protected | property | The webform submission of this ajax request. | |
WebformSubmissionAjaxResponse:: |
public | function | Gets the webform submission of this response. | |
WebformSubmissionAjaxResponse:: |
public | function | Sets the webform submission of this response. |