AppContext.php in Forena Reports 8
File
src/Context/AppContext.php
View source
<?php
namespace Drupal\forena\Context;
class AppContext {
protected $properties = [];
public static $instance;
public function __get($name) {
return isset($this->properties[$name]) ? $this->properties[$name] : NULL;
}
public function __set($name, $value) {
$this->properties[$name] = $value;
}
public static function create() {
if (static::$instance === NULL) {
static::$instance = new static();
}
return static::$instance;
}
public function getProperties() {
return $this->properties;
}
public function __wakeup() {
static::$instance = $this;
}
}