You are here

class AppContext in Forena Reports 8

Hierarchy

Expanded class hierarchy of AppContext

1 file declares its use of AppContext
AjaxPageControllerBase.php in src/Controller/AjaxPageControllerBase.php

File

src/Context/AppContext.php, line 12

Namespace

Drupal\forena\Context
View source
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;
  }

  /**
   * Singleton factory.
   * @return static
   */
  public static function create() {
    if (static::$instance === NULL) {
      static::$instance = new static();
    }
    return static::$instance;
  }
  public function getProperties() {
    return $this->properties;
  }

  /**
   * Wakeup method makes sure unserialized obejcts from the app context
   * are still set at the instance level.
   */
  public function __wakeup() {
    static::$instance = $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AppContext::$instance public static property
AppContext::$properties protected property
AppContext::create public static function Singleton factory.
AppContext::getProperties public function
AppContext::__get public function
AppContext::__set public function
AppContext::__wakeup public function Wakeup method makes sure unserialized obejcts from the app context are still set at the instance level.