Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/views/src/Ajax/ViewAjaxResponse.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\views\Ajax; | |
4 | |
5 use Drupal\Core\Ajax\AjaxResponse; | |
6 use Drupal\views\ViewExecutable; | |
7 | |
8 /** | |
9 * Custom JSON response object for an ajax view response. | |
10 * | |
11 * We use a special response object to be able to fire a proper alter hook. | |
12 */ | |
13 class ViewAjaxResponse extends AjaxResponse { | |
14 | |
15 /** | |
16 * The view executed on this ajax request. | |
17 * | |
18 * @var \Drupal\views\ViewExecutable | |
19 */ | |
20 protected $view; | |
21 | |
22 /** | |
23 * Sets the executed view of this response. | |
24 * | |
25 * @param \Drupal\views\ViewExecutable $view | |
26 * The View executed on this ajax request. | |
27 */ | |
28 public function setView(ViewExecutable $view) { | |
29 $this->view = $view; | |
30 } | |
31 | |
32 /** | |
33 * Gets the executed view of this response. | |
34 * | |
35 * @return \Drupal\views\ViewExecutable | |
36 * The View executed on this ajax request. | |
37 */ | |
38 public function getView() { | |
39 return $this->view; | |
40 } | |
41 | |
42 } |