PHP Trait Scalr\Api\Service\User\V1beta0\Controller\GlobalVariableTrait

Author: N.V.
Datei anzeigen Open project: scalr/scalr

Public Methods

Method Description
getGlobalVariable ( string $name, Scalr_Scripting_GlobalVariables $globalVar, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' ) : mixed Gets a specific global variable data
makeGlobalVariableEntity ( array $variable ) : GlobalVariable Makes GlobalVariable entity
updateGlobalVariable ( Scalr_Scripting_GlobalVariables $gvInstance, array $variable, object $object, string $name, string $scope, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' ) Updates Global Variable

Protected Methods

Method Description
getActualValue ( string $property, array $variable, object $object = null, string $objectProperty = null, mixed $defaultValue = null ) : mixed Extracts most relevant property of the Global Variable with given the possible new values
getActualVariableScope ( array $variable ) : string Extracts actual variable scope
getCleanVarDefinition ( array $variable ) : array Returns cleaned definition of a Global Variable without empty fields

Method Details

getActualValue() protected method

Extracts most relevant property of the Global Variable with given the possible new values
protected getActualValue ( string $property, array $variable, object $object = null, string $objectProperty = null, mixed $defaultValue = null ) : mixed
$property string The name of extracting property
$variable array Array representation of Global Variable that presents current state
$object object optional JSON representation of Global Variable containing a new values
$objectProperty string optional The name of extracting property in JSON representation
$defaultValue mixed optional Default return value if it's not presented in any scope
return mixed Returns the value of the property

getActualVariableScope() protected method

Extracts actual variable scope
protected getActualVariableScope ( array $variable ) : string
$variable array Array representation of Global Variable
return string

getCleanVarDefinition() protected method

Returns cleaned definition of a Global Variable without empty fields
protected getCleanVarDefinition ( array $variable ) : array
$variable array Array representation of Global Variable
return array

getGlobalVariable() public method

Gets a specific global variable data
public getGlobalVariable ( string $name, Scalr_Scripting_GlobalVariables $globalVar, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' ) : mixed
$name string Variable name
$globalVar Scalr_Scripting_GlobalVariables Instance of Global variable handler
$roleId integer optional The ID of GV Role
$farmId integer optional The ID of GV Farm
$farmRoleId integer optional The ID of GV Farm Role
$serverId string optional The ID of GV Server
return mixed

makeGlobalVariableEntity() public method

Makes GlobalVariable entity
public makeGlobalVariableEntity ( array $variable ) : GlobalVariable
$variable array The array representation of global variable
return Scalr\Model\Entity\GlobalVariable

updateGlobalVariable() public method

Updates Global Variable
public updateGlobalVariable ( Scalr_Scripting_GlobalVariables $gvInstance, array $variable, object $object, string $name, string $scope, integer $roleId, integer $farmId, integer $farmRoleId, string $serverId = '' )
$gvInstance Scalr_Scripting_GlobalVariables Instance of Global variable handler
$variable array Array representation of Global Variable that presents current state
$object object JSON representation of Global Variable containing a new values
$name string The name of the Global Variable
$scope string Scope of the Global Variable
$roleId integer optional The ID of GV Role
$farmId integer optional The ID of GV Farm
$farmRoleId integer optional The ID of GV Farm Role
$serverId string optional The ID of GV Server