function PEAR::getStaticProperty in Calendar Systems 5
If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. Eg. in your method(s) do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); You MUST use a reference, or they will not persist!
@access public
Parameters
string $class The calling classname, to prevent clashes:
string $var The variable to retrieve.:
Return value
mixed A reference to the variable. If not set it will be auto initialised to NULL.
2 calls to PEAR::getStaticProperty()
- PEAR_Error::PEAR_Error in calendar/
lib/ PEAR.php - PEAR_Error constructor
- _PEAR_call_destructors in calendar/
lib/ PEAR.php
File
- calendar/
lib/ PEAR.php, line 229
Class
- PEAR
- Base class for other PEAR classes. Provides rudimentary emulation of destructors.
Code
function &getStaticProperty($class, $var) {
static $properties;
if (!isset($properties[$class])) {
$properties[$class] = array();
}
if (!array_key_exists($var, $properties[$class])) {
$properties[$class][$var] = null;
}
return $properties[$class][$var];
}