getUiDefaults() 공개 메소드

Return default configuration vars for UI as name => value
public getUiDefaults ( ) : array
리턴 array
예제 #1
0
파일: Core.php 프로젝트: mheydt/scalr
 /**
  * @param JsonData $variables JSON encoded structure
  * @throws Scalr_Exception_Core
  * @throws Scalr_Exception_InsufficientPermissions
  * @throws \Scalr\Exception\ValidationErrorException
  */
 public function xSaveVariablesAction(JsonData $variables)
 {
     if ($this->user->isAdmin()) {
         throw new Scalr_Exception_InsufficientPermissions();
     }
     $this->request->restrictAccess(Acl::RESOURCE_GLOBAL_VARIABLES_ENVIRONMENT, Acl::PERM_GLOBAL_VARIABLES_ENVIRONMENT_MANAGE);
     $vars = new Scalr_Scripting_GlobalVariables($this->user->getAccountId(), $this->getEnvironmentId(), ScopeInterface::SCOPE_ENVIRONMENT);
     $result = $vars->setValues($variables, 0, 0, 0, '', false);
     if ($result === true) {
         $this->response->success('Variables saved');
         $this->response->data(['defaults' => $vars->getUiDefaults()]);
     } else {
         $this->response->failure();
         $this->response->data(array('errors' => array('variables' => $result)));
     }
 }