本文整理汇总了PHP中DBFarmRole::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP DBFarmRole::Load方法的具体用法?PHP DBFarmRole::Load怎么用?PHP DBFarmRole::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFarmRole
的用法示例。
在下文中一共展示了DBFarmRole::Load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xGetRoleParamsAction
public function xGetRoleParamsAction()
{
$this->request->defineParams(array('roleId' => array('type' => 'int'), 'farmId' => array('type' => 'int'), 'cloudLocation'));
try {
$dbRole = DBRole::loadById($this->getParam('roleId'));
if ($dbRole->envId != 0) {
$this->user->getPermissions()->validate($dbRole);
}
} catch (Exception $e) {
$this->response->data(array('params' => array()));
return;
}
$params = $this->db->GetAll("SELECT * FROM role_parameters WHERE role_id=? AND hash NOT IN('apache_http_vhost_template','apache_https_vhost_template')", array($dbRole->id));
foreach ($params as $key => $param) {
$value = false;
try {
if ($this->getParam('farmId')) {
$dbFarmRole = DBFarmRole::Load($this->getParam('farmId'), $this->getParam('roleId'), $this->getParam('cloudLocation'));
$value = $this->db->GetOne("SELECT value FROM farm_role_options WHERE farm_roleid=? AND hash=? LIMIT 1", array($dbFarmRole->ID, $param['hash']));
}
} catch (Exception $e) {
}
// Get field value
if ($value === false || $value === null) {
$value = $param['defval'];
}
$params[$key]['value'] = str_replace("\r", "", $value);
}
$this->response->data(array('params' => $params));
}