NAMESPACE: Bootstrap/Models

Models/Variables.php

This trait contains all the variable related functionality - saving, retrieving, deleting, etc. It is used in the main Bootstrap Model so it can be available in the actions that extend it.

public function getVariableId($varname)

Return variable id by name

variable

$varname
public function getVariableName($varid)

Return variable name by id

variable

$varid
public function getGlobalVariableByName($varname)

Return global variable for app by id

variable

$varname
public function saveNamedVariables($variables,$exclude)

Save a list of variables

variable

$variables
$exclude
public function getSavedVariable($varname,$default)

Returned saved variable for current user If not stored in memory will be queried from the database

variable

$varname
$default
public static function getVariables($gid)

Get all variables for the given application

variable

$gid
public static function getVariableContent($playid)

Get all variables for a user or return false

variable

$playid
public function getSubmittedVariableByName($varname,$default)

Get a submitted variable by name. Variables are usually submitted when you trigger a “submit-form-content” action

variable

$varname
$default
public function getAllSubmittedVariables()

Returns all submitted variables

public function getAllSubmittedVariablesByName()

Returns all submitted variables with names as key

public static function saveVariables($vars,$playid,$exclude)

Save a list of variables for given user

variable

$vars
$playid
$exclude
public function saveVariable($variable,$value)

Save single variable for current active user

variable

$variable
$value
public function deleteVariable($variablename)

Delete variable for current active user

variable

$variablename
public function loadVariables()

Load variables for the application

public function loadVariableContent($force)

Load variable content for the application

variable

$force
public function foreignVariablesGet($playid)

Retrieve all variables, which belong to a certain “playid” If you intend to use this method without passing a parameter, you may consider referring to $this->varcontent instead

variable

$playid
public function foreignVariableSave($variablename,$value,$playid)

Save variable for given user

variable

$variablename
$value
$playid