PHP Class Scalr\Model\Entity\Image

Since: 5.0 (23.05.2014)
Author: Igor Vodiasov ([email protected])
Inheritance: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\ScopeInterface, implements Scalr\DataType\AccessPermissionsInterface
Show file Open project: scalr/scalr Class Usage Examples

Public Properties

Property Type Description
$accountId integer
$agentVersion string
$architecture string
$bundleTaskId integer
$cloudLocation string
$createdByEmail string
$createdById integer
$dtAdded DateTime
$dtLastUsed DateTime
$envId integer
$hasCloudInit integer
$hash string Hash (primary key)
$id string Image ID
$isDeprecated boolean
$isScalarized integer
$name string
$osId string
$platform string
$size integer
$source string
$status string
$statusError string
$type string

Protected Properties

Property Type Description
$_environment Scalr_Environment

Public Methods

Method Description
__construct ( )
checkImage ( ) : boolean | array Check if image exists and return more info if special data exists
deleteCloudImage ( )
getDtAdded ( ) : DateTim\DateTime | null Gets normalized dtAdded
getEnvironment ( ) : null | Scalr_Environmen\Scalr_Environment Return NULL, if image is owned by admin
getOs ( ) : Scalr\Model\Entity\Os
getPlatforms ( integer $accountId, integer $envId ) : array Get array of image's platforms
getScope ( )
getSoftware ( ) : array
getSoftwareAsString ( ) : string
getUsed ( integer $accountId = null, integer $envId = null ) : array | false Get image's usage in this environment (servers, roles)
hasAccessPermissions ( $user, $environment = null, $modify = null )
isEc2EbsImage ( ) : boolean
isEc2HvmImage ( ) : boolean
isEc2InstanceStoreImage ( ) : boolean
isUsedGlobal ( ) : boolean If image is used in any environment (servers, farmRoles) or had duplicates in another environments
migrateEc2Location ( string $cloudLocation, Scalr_Account_User | User $user ) : Image Migrates an Image to another Cloud Location
save ( )
setSoftware ( array $props )

Method Details

__construct() public method

public __construct ( )

checkImage() public method

Check if image exists and return more info if special data exists
public checkImage ( ) : boolean | array
return boolean | array Returns array of data if exists when update is required

deleteCloudImage() public method

public deleteCloudImage ( )

getDtAdded() public method

Gets normalized dtAdded
public getDtAdded ( ) : DateTim\DateTime | null
return DateTim\DateTime | null

getEnvironment() public method

Return NULL, if image is owned by admin
public getEnvironment ( ) : null | Scalr_Environmen\Scalr_Environment
return null | Scalr_Environmen\Scalr_Environment

getOs() public method

public getOs ( ) : Scalr\Model\Entity\Os
return Scalr\Model\Entity\Os

getPlatforms() public static method

Get array of image's platforms
public static getPlatforms ( integer $accountId, integer $envId ) : array
$accountId integer
$envId integer
return array Array of platform's names

getScope() public method

See also: Scalr\DataType\ScopeInterface::getScope()
public getScope ( )

getSoftware() public method

public getSoftware ( ) : array
return array

getSoftwareAsString() public method

public getSoftwareAsString ( ) : string
return string

getUsed() public method

Get image's usage in this environment (servers, roles)
public getUsed ( integer $accountId = null, integer $envId = null ) : array | false
$accountId integer optional
$envId integer optional
return array | false Return array of [rolesCount, serversCount] or FALSE on failure

hasAccessPermissions() public method

See also: Scalr\DataType\AccessPermissionsInterface::hasAccessPermissions()
public hasAccessPermissions ( $user, $environment = null, $modify = null )

isEc2EbsImage() public method

public isEc2EbsImage ( ) : boolean
return boolean Return TRUE if image is ebs based

isEc2HvmImage() public method

public isEc2HvmImage ( ) : boolean
return boolean Return TRUE if image is hvm

isEc2InstanceStoreImage() public method

public isEc2InstanceStoreImage ( ) : boolean
return boolean Return TRUE if image is instance-store based

isUsedGlobal() public method

If image is used in any environment (servers, farmRoles) or had duplicates in another environments
public isUsedGlobal ( ) : boolean
return boolean

migrateEc2Location() public method

Migrates an Image to another Cloud Location
public migrateEc2Location ( string $cloudLocation, Scalr_Account_User | User $user ) : Image
$cloudLocation string The cloud location
$user Scalr_Account_User | Scalr\Model\Entity\Account\User The user object
return Image

save() public method

public save ( )

setSoftware() public method

public setSoftware ( array $props )
$props array

Property Details

$_environment protected property

protected Scalr_Environment $_environment
return Scalr_Environment

$accountId public property

public int $accountId
return integer

$agentVersion public property

public string $agentVersion
return string

$architecture public property

public string $architecture
return string

$bundleTaskId public property

public int $bundleTaskId
return integer

$cloudLocation public property

public string $cloudLocation
return string

$createdByEmail public property

public string $createdByEmail
return string

$createdById public property

public int $createdById
return integer

$dtAdded public property

public DateTime $dtAdded
return DateTime

$dtLastUsed public property

public DateTime $dtLastUsed
return DateTime

$envId public property

public int $envId
return integer

$hasCloudInit public property

public int $hasCloudInit
return integer

$hash public property

Hash (primary key)
public string $hash
return string

$id public property

Image ID
public string $id
return string

$isDeprecated public property

public bool $isDeprecated
return boolean

$isScalarized public property

public int $isScalarized
return integer

$name public property

public string $name
return string

$osId public property

public string $osId
return string

$platform public property

public string $platform
return string

$size public property

public int $size
return integer

$source public property

public string $source
return string

$status public property

public string $status
return string

$statusError public property

public string $statusError
return string

$type public property

public string $type
return string