本文整理汇总了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;
}