public function DataContext::setContext in Forena Reports 8
Same name and namespace in other branches
- 7.5 src/Context/DataContext.php \Drupal\forena\Context\DataContext::setContext()
Parameters
$id: Id of the data context to be set
$data: Data of the data context to be set.
1 call to DataContext::setContext()
- DataContext::contextExists in src/
Context/ DataContext.php - Determines whether an array context exists for the specified id. Returns true if the key exists othewise false
File
- src/
Context/ DataContext.php, line 263 - Implements \Drupal\forena\Context\DataContext
Class
- DataContext
- The DataContext class holds all of the data contexts during the report rendering process. The general idea is that during the report render, data objects are pushed on the stack with the id's of the block or foreach objects that invoke them.
Namespace
Drupal\forena\ContextCode
public function setContext($id, &$data) {
if (is_object($data)) {
$this->data_sources[$id] = $data;
}
else {
$this->data_sources[$id] =& $data;
}
}