class PreCacheEvent in Views Json Source 8
Class PreCacheEvent.
Hierarchy
- class \Drupal\views_json_source\Event\PreCacheEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of PreCacheEvent
1 file declares its use of PreCacheEvent
- ViewsJsonQuery.php in src/
Plugin/ views/ query/ ViewsJsonQuery.php
File
- src/
Event/ PreCacheEvent.php, line 11
Namespace
Drupal\views_json_source\EventView source
class PreCacheEvent extends Event {
/**
* Pre cache constant.
*/
const VIEWS_JSON_SOURCE_PRE_CACHE = 'views_json_source.pre_cache';
/**
* The view executable.
*
* @var \Drupal\views\ViewExecutable
*/
protected $viewExecutable;
/**
* The views json query result body.
*
* @var string
*/
protected $data;
/**
* Constructs the object.
*
* @param \Drupal\views\ViewExecutable $viewExecutable
* The view executable.
* @param string $data
* The views json query result body.
*/
public function __construct(ViewExecutable $viewExecutable, string $data) {
$this->viewExecutable = $viewExecutable;
$this->data = $data;
}
/**
* Get view executable.
*
* @return \Drupal\views\ViewExecutable
* Return view executable.
*/
public function getViewExecutable() : ViewExecutable {
return $this->viewExecutable;
}
/**
* Get view result data.
*
* @return string
* Return view data.
*/
public function getViewData() : string {
return $this->data;
}
/**
* Set the data for this event.
*
* @param string $data
* The data to override view result data.
*/
public function setViewData(string $data) {
$this->data = $data;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PreCacheEvent:: |
protected | property | The views json query result body. | |
PreCacheEvent:: |
protected | property | The view executable. | |
PreCacheEvent:: |
public | function | Get view result data. | |
PreCacheEvent:: |
public | function | Get view executable. | |
PreCacheEvent:: |
public | function | Set the data for this event. | |
PreCacheEvent:: |
constant | Pre cache constant. | ||
PreCacheEvent:: |
public | function | Constructs the object. |