PHP 클래스 Scalr\Model\Entity\Farm

저자: N.V.
상속: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\AccessPermissionsInterface
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$accountId integer Account Id
$added DateTime Added time
$changed string Last change time TODO: convert to DateTime with MySQL 5.6
$changedById integer Last editor Id
$comments string Comments
$createdByEmail string Creator E-Mail
$envId integer Environment Id
$hash string Hash
$id integer Identifier
$isCompleted boolean Completion status
$launchOrder boolean Launch order type
$launched DateTime Launched time
$name string Farm name
$ownerId integer Creator Id
$region string Region name
$status integer Status
$termOnSyncFail boolean Synchronization fail flag

보호된 프로퍼티들

프로퍼티 타입 설명
$_environment Scalr\Model\Entity\Account\Environment
$_farmRoles Scalr\Model\Collections\EntityIterator | FarmRole[] Farm roles collection
$_servers Scalr\Model\Collections\EntityIterator | Server[] Servers collection
$_settings Scalr\Model\Collections\SettingsCollection Farm settings collection
$_teams Scalr\Model\Collections\EntityIterator | Scalr\Model\Entity\Account\Team[] The Farm teams
$_teamsChanged boolean True value indicates that the set of the Teams associated with the Farm has been changed within the object with respect to database.

공개 메소드들

메소드 설명
__clone ( ) Reset farm id on clone
__get ( string $name ) : mixed Magic getter.
appendTeams ( Team $team ) : Farm Appends Teams list
checkLocked ( ) Checks if farm is locked
cloneFarm ( string $name, User $user ) : Farm Creates clone for the farm TODO: refactor farms cloning
delete ( )
deleteScheduled ( ) Delete scheduled tasks
findWithTeams ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : ArrayCollection | Farm[] Searches farms by criteria and selecting and initiating their Teams
getEnvironment ( ) : Environment | null Return Environment entity
getStatusName ( integer $status ) : string Translates status codes to status names
getTeams ( ) : EntityIterator | Team[] Gets the list of the Teams which own the Farm
getUserTeamOwnershipSql ( integer $userId, integer $farmId = null ) : string Generate SQL query like "EXISTS(SELECT 1 FROM farm_teams .
hasAccessPermissions ( User $user, Environment $environment = null, string | boolean $modify = null ) : boolean
hasUserTeamOwnership ( User $user ) : boolean Check if given user belongs to team, which has access to farm
isTeamsChanged ( ) : boolean Checks whether the set of the Teams associated with the Farm has been changed.
launch ( User $user = null, array $auditLogExtra = null ) : Farm Launch this farm
lock ( User $user, string $comment, boolean $restrict = false ) : Farm Locks this farm
save ( )
saveTeams ( EntityIterator | Team[] $teams ) Associates a Farm with specified Teams.
setTeams ( EntityIterator | Team[] $teams ) Sets the list of the Teams which own the Farm
unlock ( User $user ) : Farm Unlocks this farm

메소드 상세

__clone() 공개 메소드

Reset farm id on clone
public __clone ( )

__get() 공개 메소드

Gets the values of the properties that require initialization.
public __get ( string $name ) : mixed
$name string Name of property that is accessed
리턴 mixed Returns property value

appendTeams() 공개 메소드

Appends Teams list
public appendTeams ( Team $team ) : Farm
$team Scalr\Model\Entity\Account\Team The Team entity
리턴 Farm

checkLocked() 공개 메소드

Checks if farm is locked
public checkLocked ( )

cloneFarm() 공개 메소드

Creates clone for the farm TODO: refactor farms cloning
public cloneFarm ( string $name, User $user ) : Farm
$name string The name of a new Farm
$user Scalr\Model\Entity\Account\User The User that initiates cloning
리턴 Farm Returns clone

delete() 공개 메소드

또한 보기: AbstractEntity::delete()
public delete ( )

deleteScheduled() 공개 메소드

Delete scheduled tasks
public deleteScheduled ( )

findWithTeams() 공개 정적인 메소드

Searches farms by criteria and selecting and initiating their Teams
public static findWithTeams ( array $criteria = null, array $group = null, array $order = null, integer $limit = null, integer $offset = null, boolean $countRecords = null ) : ArrayCollection | Farm[]
$criteria array optional The search criteria.
$group array optional The group by looks like [property1, ...], by default groups by `id`
$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
리턴 Scalr\Model\Collections\ArrayCollection | Farm[] Returns collection of the entities.

getEnvironment() 공개 메소드

Return Environment entity
public getEnvironment ( ) : Environment | null
리턴 Scalr\Model\Entity\Account\Environment | null

getStatusName() 공개 정적인 메소드

Translates status codes to status names
public static getStatusName ( integer $status ) : string
$status integer Status code
리턴 string Status name

getTeams() 공개 메소드

Gets the list of the Teams which own the Farm
public getTeams ( ) : EntityIterator | Team[]
리턴 Scalr\Model\Collections\EntityIterator | Scalr\Model\Entity\Account\Team[]

getUserTeamOwnershipSql() 공개 정적인 메소드

... WHERE ...) to check FARM_TEAMS permission. Table farms should have alias f. If farmId is set, when JOIN table farms to get envId from it.
public static getUserTeamOwnershipSql ( integer $userId, integer $farmId = null ) : string
$userId integer Identifier of User
$farmId integer optional Identifier of Farm
리턴 string

hasAccessPermissions() 공개 메소드

public hasAccessPermissions ( User $user, Environment $environment = null, string | boolean $modify = null ) : boolean
$user Scalr\Model\Entity\Account\User The User Entity
$environment Scalr\Model\Entity\Account\Environment optional The Environment Entity
$modify string | boolean optional ACL Permission Identifier or boolean flag whether it should check modify permissions or not.
리턴 boolean

hasUserTeamOwnership() 공개 메소드

Check if given user belongs to team, which has access to farm
public hasUserTeamOwnership ( User $user ) : boolean
$user Scalr\Model\Entity\Account\User User entity
리턴 boolean

isTeamsChanged() 공개 메소드

Checks whether the set of the Teams associated with the Farm has been changed.
public isTeamsChanged ( ) : boolean
리턴 boolean Returns true if the set of the Teams that is associated with the Farm has been changed

launch() 공개 메소드

Launch this farm
public launch ( User $user = null, array $auditLogExtra = null ) : Farm
$user Scalr\Model\Entity\Account\User optional The user who initiates Farm launch
$auditLogExtra array optional Audit log extra fields to record
리턴 Farm

lock() 공개 메소드

Locks this farm
public lock ( User $user, string $comment, boolean $restrict = false ) : Farm
$user Scalr\Model\Entity\Account\User The User on whose behalf the lock set
$comment string Comment describing the reason and/or purpose of the lock
$restrict boolean optional Strict lock flag (I have no idea what that means [author's note])
리턴 Farm

save() 공개 메소드

또한 보기: AbstractEntity::save()
public save ( )

saveTeams() 공개 메소드

This method should only be called within a transaction.
public saveTeams ( EntityIterator | Team[] $teams )
$teams Scalr\Model\Collections\EntityIterator | Scalr\Model\Entity\Account\Team[] Collection of the Teams

setTeams() 공개 메소드

Sets the list of the Teams which own the Farm
public setTeams ( EntityIterator | Team[] $teams )
$teams Scalr\Model\Collections\EntityIterator | Scalr\Model\Entity\Account\Team[] The list of the Teams that which own the Farm

unlock() 공개 메소드

Unlocks this farm
public unlock ( User $user ) : Farm
$user Scalr\Model\Entity\Account\User The User on whose behalf the lock unset
리턴 Farm

프로퍼티 상세

$_environment 보호되어 있는 프로퍼티

protected Environment,Scalr\Model\Entity\Account $_environment
리턴 Scalr\Model\Entity\Account\Environment

$_farmRoles 보호되어 있는 프로퍼티

Farm roles collection
protected EntityIterator,Scalr\Model\Collections|FarmRole[],Scalr\Model\Entity $_farmRoles
리턴 Scalr\Model\Collections\EntityIterator | FarmRole[]

$_servers 보호되어 있는 프로퍼티

Servers collection
protected EntityIterator,Scalr\Model\Collections|Server[],Scalr\Model\Entity $_servers
리턴 Scalr\Model\Collections\EntityIterator | Server[]

$_settings 보호되어 있는 프로퍼티

Farm settings collection
protected SettingsCollection,Scalr\Model\Collections $_settings
리턴 Scalr\Model\Collections\SettingsCollection

$_teams 보호되어 있는 프로퍼티

The Farm teams
protected EntityIterator,Scalr\Model\Collections|Team[],Scalr\Model\Entity\Account $_teams
리턴 Scalr\Model\Collections\EntityIterator | Scalr\Model\Entity\Account\Team[]

$_teamsChanged 보호되어 있는 프로퍼티

True value indicates that the set of the Teams associated with the Farm has been changed within the object with respect to database.
protected bool $_teamsChanged
리턴 boolean

$accountId 공개적으로 프로퍼티

Account Id
public int $accountId
리턴 integer

$added 공개적으로 프로퍼티

Added time
public DateTime $added
리턴 DateTime

$changed 공개적으로 프로퍼티

Last change time TODO: convert to DateTime with MySQL 5.6
public string $changed
리턴 string

$changedById 공개적으로 프로퍼티

Last editor Id
public int $changedById
리턴 integer

$comments 공개적으로 프로퍼티

Comments
public string $comments
리턴 string

$createdByEmail 공개적으로 프로퍼티

Creator E-Mail
public string $createdByEmail
리턴 string

$envId 공개적으로 프로퍼티

Environment Id
public int $envId
리턴 integer

$hash 공개적으로 프로퍼티

Hash
public string $hash
리턴 string

$id 공개적으로 프로퍼티

Identifier
public int $id
리턴 integer

$isCompleted 공개적으로 프로퍼티

Completion status
public bool $isCompleted
리턴 boolean

$launchOrder 공개적으로 프로퍼티

Launch order type
public bool $launchOrder
리턴 boolean

$launched 공개적으로 프로퍼티

Launched time
public DateTime $launched
리턴 DateTime

$name 공개적으로 프로퍼티

Farm name
public string $name
리턴 string

$ownerId 공개적으로 프로퍼티

Creator Id
public int $ownerId
리턴 integer

$region 공개적으로 프로퍼티

Region name
public string $region
리턴 string

$status 공개적으로 프로퍼티

Status
public int $status
리턴 integer

$termOnSyncFail 공개적으로 프로퍼티

Synchronization fail flag
public bool $termOnSyncFail
리턴 boolean