You are here

Context.php in Forena Reports 8

Same filename and directory in other branches
  1. 7.5 src/Context/Context.php

File

src/Context/Context.php
View source
<?php

/**
 * Interface class for Data contexts.
 * @author metzlerd
 * The basic context type implements
 */
namespace Drupal\forena\Context;

class Context {
  private $values;
  public function __construct() {
    $this->values = array();
  }
  public function getValue($key) {
    $value = @$this->values[$key];
    return $value;
  }
  public function setValue($key, $value) {
    $this->values[$key] = $value;
  }

  /**
   * @param string $name
   *   Paramater to get.
   * Create getter and setter so that you can act as objects.
   */
  public function __get($name) {
    $this
      ->getValue($name);
  }

  /**
   * @param $name
   * @param $value
   * General getter and setter for key value pairs
   */
  public function __set($name, $value) {
    $this
      ->setValue($name, $value);
  }

}

Classes

Namesort descending Description
Context