本文整理汇总了PHP中Scalr_Model::loadBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Scalr_Model::loadBy方法的具体用法?PHP Scalr_Model::loadBy怎么用?PHP Scalr_Model::loadBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scalr_Model
的用法示例。
在下文中一共展示了Scalr_Model::loadBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadGlobalByFarmId
public function loadGlobalByFarmId($farmId, $cloudLocation, $platform)
{
$info = $this->db->GetRow("SELECT * FROM ssh_keys WHERE `farm_id`=? AND (`cloud_location`=? OR `cloud_location` = '') AND `type`=? AND `platform` = ? LIMIT 1", array($farmId, $cloudLocation, self::TYPE_GLOBAL, $platform));
if (!$info) {
return false;
} else {
return parent::loadBy($info);
}
}
示例2: loadGlobalByFarmId
public function loadGlobalByFarmId($envId, $farmId, $cloudLocation, $platform)
{
$sql = "SELECT * FROM ssh_keys WHERE `env_id` = ? AND (`cloud_location`=? OR `cloud_location` = '') AND `type`=? AND `platform` = ?";
$params = [$envId, $cloudLocation, self::TYPE_GLOBAL, $platform];
if ($farmId == 0 || $farmId == NULL) {
$sql .= ' AND `farm_id` IS NULL';
} else {
$sql .= 'AND `farm_id` = ?';
$params[] = $farmId;
}
$sql .= ' LIMIT 1';
$info = $this->db->GetRow($sql, $params);
if (!$info) {
return false;
} else {
return parent::loadBy($info);
}
}
示例3: loadBy
public function loadBy($info)
{
parent::loadBy($info);
error_reporting(E_ALL);
$ini_params = @parse_ini_file(dirname(__FILE__) . "/../../www/storage/service-configuration-manifests/{$this->roleBehavior}.ini", true, INI_SCANNER_RAW);
foreach ($ini_params as $param => $props) {
if ($param == '__defaults__') {
continue;
}
$this->parameters[] = new Scalr_ServiceConfigurationParameter($param, $props['default-value'], $props['type'], $props['description'], $props['allowed-values'], $props['group']);
}
if ($this->id) {
//load actual values from database;
$params = $this->db->Execute("SELECT * FROM service_config_preset_data WHERE preset_id = ?", array($this->id));
while ($param = $params->FetchRow()) {
$this->setParameterValue($param['key'], $param['value']);
}
}
return $this;
}
示例4: loadBy
function loadBy($info)
{
parent::loadBy($info);
$this->settings = unserialize($this->settingsRaw);
return $this;
}