本文整理汇总了PHP中Setting::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::Load方法的具体用法?PHP Setting::Load怎么用?PHP Setting::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::Load方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setSetting
public function setSetting($name, $value)
{
$setting = new Setting();
$setting->Load("name = ?", array($name));
if ($setting->name == $name) {
$setting->value = $value;
$setting->Save();
}
}
示例2: getSetting
public function getSetting($name)
{
$setting = new Setting();
$setting->Load("name = ?", array($name));
if ($setting->name == $name) {
return $setting->value;
}
return null;
}
示例3: getInstanceKey
public function getInstanceKey()
{
$settings = new Setting();
$settings->Load("name = ?", array("Instance: Key"));
if ($settings->name != "Instance: Key") {
return null;
}
return $settings->value;
}
示例4: getInstanceId
public function getInstanceId()
{
$settings = new Setting();
$settings->Load("name = ?", array("Instance : ID"));
if ($settings->name != "Instance : ID") {
$settings->value = md5(time());
$settings->name = "Instance : ID";
$settings->Save();
}
return $settings->value;
}