Return the variable's value from the store.

@access public
@param  string $variable The name of the variable in the store.
@return mixed
@throws Exception        If the variable does not exist.
@static
173276
public static function get($variable) {
		self::startSessionIfNeeded();
		// If it exists, and we do not want to overwrite, then throw exception
		if (! self::has($variable)) {
			throw new \Exception("{$variable} does not exist in the store.");
		}

		return unserialize($_SESSION[$variable]);
	}
422483
protected function evalVarLabel($variable)
    {
        $type = $this->getType($variable);
        switch ($type) {
            case 'object':
                return $this->evalObjLabel($variable);

            case 'array':
                return $type . '('.count($variable).')';

            default:
                return $type;
        }
    }
64622
def open_store_variable(self, name, var):
        """"""
        data = indexing.LazilyOuterIndexedArray(CDMArrayWrapper(name, self))
        return Variable(var.dimensions, data, {a: getattr(var, a) for a in var.ncattrs()})
959738
public static function get($variable, $default = null) {
    return isset(self::$apiConfig[$variable]) ? self::$apiConfig[$variable] : $default;
  }
1192235
static public function getType ($var) {
		switch (true) {
			case is_bool($var):
				return self::TYPE_BOOL;
			case is_float($var):
				return self::TYPE_FLOAT;
			case is_int($var):
				return self::TYPE_INT;
			case is_string($var):
				return self::TYPE_STRING;
			case is_array($var):
				return self::TYPE_COLLECTION;
			default:
				throw new \Exception("Invalid type of var");
		}
	}
1316169
public static function get($key)
    {
        $key = strtoupper($key);

        $list = static::loadConstants();

        if(array_key_exists($key,$list))
            return static::loadConstants()[$key];

        if(static::exist($key))
            return $key;

        // Throw exception.
        static::invalidType();
    }
126588
public static function getVariable(string $name): stdClass
    {
        self::loadData();
        if (isset(Search::$data->vars->{$name})) {
            return Search::$data->vars->{$name};
        } else {
            throw new KBException("$name does not exist !");
        }
    }
335791
public function getVar($varName)
    {
        if (!isset($this->variableList[$varName])) {
            trigger_error('Variable "' . $varName . '" isn\'t defined in View.', E_USER_WARNING);
            return false;
        }
        return $this->variableList[$varName];
    }
763734
public function getGlobalVar($variable)
    {
        $uri = "asterisk/variable?variable=$variable";

        try {
            $response = $this->client->getEndpoint()->get($uri);
        } catch (RequestException $e) {
            $this->processRequestException($e);
        }

        return new Variable(\GuzzleHttp\json_decode($response->getBody()));
    }
1082267
public function filterSession($variableName) {
        if(!is_string($variableName)) {
            throw new \Exception('Variable name expected as string');
        }
        
        if(!isset($_SESSION[$variableName])) {
            return null;
        }
        
        return $this->filter($_SESSION[$variableName]);
    }
456617
public static function getTypeFromPHPVariable($variable) : ?Type
    {
        if (is_object($variable)) {
            if ($variable instanceof DateTimeInterface) {
                return self::getType('date');
            }

            if ($variable instanceof ObjectId) {
                return self::getType('id');
            }
        } else {
            $type = gettype($variable);
            switch ($type) {
                case 'integer':
                    return self::getType('int');
            }
        }
        return null;
    }
527409
protected function evalVarDump($variable)
    {
        $dumper = new HtmlDumper;
        $cloner = new VarCloner;

        $output = '<div style="display:none">';
        $output .= $dumper->dump($cloner->cloneVar($variable), true);
        $output .= '</div>';

        return $output;
    }
246915
public function setVars($variables)
    {
        if (!is_array($variables) && !$variables instanceof ArrayAccess) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Expected array or ArrayAccess object; received "%s"',
                (is_object($variables) ? get_class($variables) : gettype($variables))
            ));
        }

        // Enforce a Variables container
        if (!$variables instanceof Variables) {
            $variablesAsArray = array();
            foreach ($variables as $key => $value) {
                $variablesAsArray[$key] = $value;
            }
            $variables = new Variables($variablesAsArray);
        }

        $this->__vars = $variables;
        return $this;
    }
1029835
private function getOnceVarName()
    {
        $name = (string) $this->getRequiredParameter('name');
        $varName = preg_replace('/[^a-zA-Z0-9_]+/i', '', $name);
        if (empty($varName))
            throw new Exception('variable name [' . $name . '] is invalid');

        return $varName;
    }
934020
protected function getPresenterMethodFromVariable($variable)
    {
        $method = 'present'.str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $variable)));
        if (method_exists($this, $method)) {
            return $method;
        }
    }
1289539
public static function getTypeFromPHPVariable($variable)
    {
        if (is_object($variable)) {
            if ($variable instanceof \DateTime) {
                return self::getType('date');
            } elseif ($variable instanceof \MongoId) {
                return self::getType('id');
            }
        } else {
            $type = gettype($variable);
            switch ($type) {
                case 'integer';
                    return self::getType('int');
            }
        }
        return null;
    }
1365199
public static function convertVariableTo(\PHY\Variable\AVar $variable, $convertTo = 'Obj')
        {
            $method = 'to'.$convertTo;
            if (!is_callable([$variable, $method])) {
                throw new \PHY\Variable\Exception('Could not convert "'.$variable->getType().'" to "'.$convertTo.'"');
            }
            $value = $variable->{$method}();
            return static::create($convertTo, $value);
        }