本文整理匯總了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));
}