本文整理匯總了PHP中Variable::getValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Variable::getValue方法的具體用法?PHP Variable::getValue怎麽用?PHP Variable::getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Variable
的用法示例。
在下文中一共展示了Variable::getValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetch
private static function fetch($name, $default)
{
global $cache;
$cache_key = static::buildCacheKey($name);
$cache_value = $cache->get($cache_key);
if ($cache_value === NULL) {
try {
$var = new Variable($name);
$cache_value = $var->getValue();
} catch (fNotFoundException $e) {
$cache_value = $default;
}
$cache->set($cache_key, $cache_value);
}
return $cache_value;
}
示例2: deleteVariable
public function deleteVariable(Variable $variableToDelete)
{
if ($variableToDelete->isReadOnly()) {
return false;
}
$database = Database::getInstance();
if (!$database->isConnected()) {
return false;
}
$variableName = $database->escapeString(htmlspecialchars($variableToDelete->getName()));
$variableValue = $database->escapeString(htmlspecialchars($variableToDelete->getValue()));
if (!$database->removeData('variable', "variableName = '{$variableName}' AND variableValue = '{$variableValue}'")) {
return false;
}
return true;
}
示例3: addColumnVariable
public function addColumnVariable(Variable $variable, $alias = null)
{
if (is_null($alias)) {
$alias = $variable->getValue();
}
if (isset($this->columns[$alias])) {
throw new MalformedSqlException("Column alias '{$alias}' already defined!");
}
$this->columns[$alias] = $variable;
}