tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Context

Source Location: /core/context.class.php

Class Context

Descendants
Child Class Description
Web_Context Container for all PHP predefined variables

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Property Summary
array   $vars   Storage for the values

[ Top ]
Method Summary
Context   __construct()   Constructor
void   add_var()   Adds new variable.
any   &get_var()   Gets variable as reference. Use this function if you intend to change the value.
any   query_var()   Query variable. Similar to get_var() but returns copy of the variable, not reference. Use this function instead of get_var() if you are not intending to change the value.
void   set_var()   Sets variable.
boolean   vars_exists()   Checks if var exists (it is already set)
void   _set_var()   Actual set of the variable

[ Top ]
Properties
array   $vars = array() [line 40]

Storage for the values

API Tags:
Access:  private


[ Top ]
Methods
Constructor __construct  [line 49]

  Context __construct( [ &$vars = NULL], array $vars  )

Constructor

Parameters:
array   $vars:  Simple associative array used to initialize private $vars.
   &$vars: 

Information Tags:
Throws:  TE_Not_An_Array

Redefined in descendants as:

[ Top ]
add_var  [line 66]

  void add_var( string $name, &$value, any $value  )

Adds new variable.

Parameters:
string   $name: 
any   $value: 
   &$value: 

API Tags:
Access:  public


[ Top ]
get_var  [line 99]

  any &get_var( string $name  )

Gets variable as reference. Use this function if you intend to change the value.

Parameters:
string   $name: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Var_Not_Exists

[ Top ]
query_var  [line 113]

  any query_var( string $name  )

Query variable. Similar to get_var() but returns copy of the variable, not reference. Use this function instead of get_var() if you are not intending to change the value.

Parameters:
string   $name: 

API Tags:
Access:  public


[ Top ]
set_var  [line 83]

  void set_var( string $name, any $value  )

Sets variable.

Throws exception if variable with name provided with $name does not exists.

Parameters:
string   $name: 
any   $value: 

API Tags:
Access:  public

Information Tags:
Throws:  TE_Var_Not_Exists

[ Top ]
vars_exists  [line 127]

  boolean vars_exists( string $key  )

Checks if var exists (it is already set)

Parameters:
string   $key: 

API Tags:
Access:  public


[ Top ]
_set_var  [line 144]

  void _set_var( string $name, &$value, any $value  )

Actual set of the variable

Parameters:
string   $name: 
any   $value: 
   &$value: 

API Tags:
Access:  private


[ Top ]