Свойство | Type | Description | |
---|---|---|---|
$accountId | integer | It is set when the Role is from account scope | |
$added | DateTime | The timestamp when the Role was added | |
$addedByEmail | integer | The email address of the User who added the Role | |
$addedByUserId | integer | The identifier of the User who added the Role | |
$behaviors | string | The list of the supported behaviors | |
$catId | integer | Identifier of the category | |
$description | string | The description | |
$envId | integer | It is set when the Role is from environment scope | |
$generation | integer | The generation | |
$id | integer | The identifier of the Role | |
$isDeprecated | boolean | Whether the role is deprecated | |
$isDevelopment | boolean | Whether it is development Role | |
$isQuickStart | boolean | Whether it is QuickStart Role | |
$isScalarized | boolean | Whether it is Scalarized Role | |
$lastUsed | DateTime | The timestamp when the Role was used last time | |
$name | string | The name of the role | |
$origin | string | ||
$osId | string | The identifier of the OS |
Свойство | Type | Description | |
---|---|---|---|
$behaviorsOverlaps | array | Rules of behavior compatibility Implies that the DB behaviors is mutually exclusive | |
$dbBehaviors | array | List of DB behaviors It is used to generate mutually exclusive rules of behavior compatibility |
Méthode | Description | |
---|---|---|
__construct ( ) | Constructor | |
fetchImagesArray ( ) : array | Gets the list of the Images which correspond to the Role | |
getAllowedEnvironments ( ) : array | Return array of environments where this role is allowed explicitly. | |
getBehaviors ( ) : string[] | Gets role behaviors list | |
getBehaviorsConflicts ( array $behaviors ) : array | Checks given set of behaviors on compatibility | |
getDbMsrBehavior ( ) : boolean | string | If role has any database behavior, it will return behavior's name | |
getFarmsCount ( integer $accountId = null, integer $envId = null ) : integer | Gets the number of Farms which are using this Role | |
getImage ( $platform, $cloudLocation ) : RoleImage | Finds out the Image that corresponds to the Role by the specified criteria | |
getImages ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : |
Gets Images which are associated with the Role | |
getOs ( ) : Os | Gets the Os entity which corresponds to the Role | |
getScope ( ) | ||
getScripts ( ) : array | Get scripts of the Role TODO refactor this method to new Entities | |
getServersCount ( string $accountId = null, string $envId = null ) : integer | Get the number of Servers which are using this Role | |
hasAccessPermissions ( $user, $environment = null, $modify = null ) | ||
hasBehavior ( string $behavior ) : boolean | Check if role has behavior | |
hasDbBehavior ( ) : boolean | Check if Role has database behavior | |
isNameUsed ( string $name, integer $accountId, integer $envId, integer $ignoreRoleId = null ) : boolean | Check if given name is used on scalr, account or environment scopes | |
isUsed ( ) : boolean | Checks whether the Role is already used in some Farm | |
isValidName ( string $name ) : boolean | Validates the name | |
save ( ) | ||
setBehaviors ( array | |
Sets role behaviors | |
setImage ( string $platform, string $cloudLocation, string $imageId, integer $userId, string $userEmail ) | Add, replace or remove image in role | |
setScripts ( array $scripts ) | Set scripts of the Role TODO refactor this method to new Entities |
public fetchImagesArray ( ) : array | ||
Résultat | array | Return array of all role's images in format: [platform][cloudLocation] = [id, architecture, type] |
public getAllowedEnvironments ( ) : array | ||
Résultat | array | Array of envId |
public getBehaviors ( ) : string[] | ||
Résultat | string[] |
public static getBehaviorsConflicts ( array $behaviors ) : array | ||
$behaviors | array | Array of a Role behaviors |
Résultat | array | Returns an array of behaviors that cannot be used together |
public getDbMsrBehavior ( ) : boolean | string | ||
Résultat | boolean | string | Name of database behavior of false |
public getImage ( $platform, $cloudLocation ) : RoleImage | ||
$platform | string The cloud platform | |
$cloudLocation | string The cloud location | |
Résultat | RoleImage | Returns the RoleImage object. It throws an exception when the RoleImage does not exist |
public getImages ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : |
||
$criteria | array | optional The search criteria on the Image result set. |
$group | array | optional The group parameter |
$order | array | optional The results order looks like [[property1 => true|false], ...] |
$limit | integer | optional The records limit |
$offset | integer | optional The offset |
$countRecords | boolean | optional True to calculate total number of the records without limit |
Résultat | Returns Images which are associated with the role |
public getOs ( ) : Os | ||
Résultat | Os | Returns the Os entity which corresponds to the Role. If OS has not been defined it will return NULL. |
public getScripts ( ) : array | ||
Résultat | array |
public hasAccessPermissions ( $user, $environment = null, $modify = null ) |
public hasBehavior ( string $behavior ) : boolean | ||
$behavior | string | Behavior name |
Résultat | boolean | Returns true if role has behavior, false otherwise |
public hasDbBehavior ( ) : boolean | ||
Résultat | boolean |
public static isNameUsed ( string $name, integer $accountId, integer $envId, integer $ignoreRoleId = null ) : boolean | ||
$name | string | Role's name to check |
$accountId | integer | Identifier of account |
$envId | integer | Identifier of environment |
$ignoreRoleId | integer | Role id to ignore |
Résultat | boolean | Returns TRUE if a such name has been already used on scalr or account (or environment) scopes |
public static isValidName ( string $name ) : boolean | ||
$name | string | The name of the Role |
Résultat | boolean | Returns TRUE when the name is valid or FALSE otherwise |
public setBehaviors ( array | |
||
$behaviors | array | |
Array of behaviors |
public setImage ( string $platform, string $cloudLocation, string $imageId, integer $userId, string $userEmail ) | ||
$platform | string | The cloud platform |
$cloudLocation | string | The cloud location |
$imageId | string | optional Either Identifier of the Image to add or NULL to remove |
$userId | integer | The identifier of the User who adds the Image |
$userEmail | string | The email address of the User who adds the Image |
public setScripts ( array $scripts ) | ||
$scripts | array |
public int $accountId | ||
Résultat | integer |
public DateTime $added | ||
Résultat | DateTime |
public int $addedByEmail | ||
Résultat | integer |
public int $addedByUserId | ||
Résultat | integer |
public string $behaviors | ||
Résultat | string |
protected static array $behaviorsOverlaps | ||
Résultat | array |
protected static array $dbBehaviors | ||
Résultat | array |
public int $envId | ||
Résultat | integer |
public bool $isDeprecated | ||
Résultat | boolean |
public bool $isDevelopment | ||
Résultat | boolean |
public bool $isQuickStart | ||
Résultat | boolean |
public bool $isScalarized | ||
Résultat | boolean |
public DateTime $lastUsed | ||
Résultat | DateTime |