Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
3 / 3
ViewAjaxResponse
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
3 / 3
 setView
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getView
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
/**
 * @file
 * Contains \Drupal\views\Ajax\ViewAjaxResponse.
 */
namespace Drupal\views\Ajax;
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\views\ViewExecutable;
/**
 * Custom JSON response object for an ajax view response.
 *
 * We use a special response object to be able to fire a proper alter hook.
 */
class ViewAjaxResponse extends AjaxResponse {
  /**
   * The view executed on this ajax request.
   *
   * @var \Drupal\views\ViewExecutable
   */
  protected $view;
  /**
   * Sets the executed view of this response.
   *
   * @param \Drupal\views\ViewExecutable $view
   *   The View executed on this ajax request.
   */
  public function setView(ViewExecutable $view) {
    $this->view = $view;
  }
  /**
   * Gets the executed view of this response.
   *
   * @return \Drupal\views\ViewExecutable $view
   *   The View executed on this ajax request.
   */
  public function getView() {
    return $this->view;
  }
}