PHP Класс Scalr\Stats\CostAnalytics\Entity\ProjectEntity

С версии: 5.0 (11.02.2014)
Автор: Vitaliy Demidov ([email protected])
Наследование: extends Scalr\Model\AbstractEntity, implements Scalr\DataType\AccessPermissionsInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$accountId integer Global by default
$archived boolean Whether the project has been archived
$ccId string Cost centre identifier (UUID)
$created DateTime The date the record was created on
$createdByEmail string Email address of the user who created record
$createdById integer Identifier of the user who created this project
$envId integer It's used only in combination with share type - 3
$name string The name of the cost centre
$projectId string Project identifier (UUID)
$shared integer Share type

Открытые методы

Метод Описание
__construct ( ) Constructor
checkRemoval ( ) : boolean Checks whether project can be removed
delete ( )
getCostCenter ( ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity Gets parent Cost Center
getFarmsList ( ) : array Get the list of the farms which are assigned to specified project
getProperties ( ) : ArrayCollection | null Gets all collection of the properties for this cost centre
getProperty ( string $name, boolean $ignoreCache = false ) : string | null Gets property with name
getQuarterlyBudget ( integer $year ) : ArrayCollection Gets quarterly budget of specified year for the Project
hasAccessPermissions ( $user, $environment = null, $modify = null )
loadProperties ( ) Loads all properties to entity
save ( )
saveProperty ( string $name, string $value ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity Saves property
setCostCenter ( Scalr\Stats\CostAnalytics\Entity\CostCentreEntity $cc = null ) : ProjectEntity Sets a parent costcenter
setProperty ( string $name, string $value ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity Sets property with specified name

Описание методов

__construct() публичный Метод

Constructor
public __construct ( )

checkRemoval() публичный Метод

If Project can't be archived and removed it will throw an exception
public checkRemoval ( ) : boolean
Результат boolean Returns TRUE if Project can be removed or false if it can be archived or throws an exception otherwise

delete() публичный Метод

См. также: Scalr\Model\AbstractEntity::delete()
public delete ( )

getCostCenter() публичный Метод

Gets parent Cost Center
public getCostCenter ( ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity
Результат Scalr\Stats\CostAnalytics\Entity\CostCentreEntity Returns cost centre entity

getFarmsList() публичный Метод

Get the list of the farms which are assigned to specified project
public getFarmsList ( ) : array
Результат array Returns the array looks like [farm_id => name]

getProperties() публичный Метод

Gets all collection of the properties for this cost centre
public getProperties ( ) : ArrayCollection | null
Результат Scalr\Model\Collections\ArrayCollection | null

getProperty() публичный Метод

Gets property with name
public getProperty ( string $name, boolean $ignoreCache = false ) : string | null
$name string The name of the property
$ignoreCache boolean optional Should it ignore cache or not
Результат string | null Returns the property entity or null

getQuarterlyBudget() публичный Метод

Gets quarterly budget of specified year for the Project
public getQuarterlyBudget ( integer $year ) : ArrayCollection
$year integer The year
Результат Scalr\Model\Collections\ArrayCollection Returns collection of the QuarterlyBudgetEntity objects

hasAccessPermissions() публичный Метод

См. также: AccessPermissionsInterface::hasAccessPermissions()
public hasAccessPermissions ( $user, $environment = null, $modify = null )

loadProperties() публичный Метод

Loads all properties to entity
public loadProperties ( )

save() публичный Метод

См. также: Scalr\Model\AbstractEntity::save()
public save ( )

saveProperty() публичный Метод

It will immediately save specified record to database, so that cost centre must exist before you call this method.
public saveProperty ( string $name, string $value ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity
$name string The unique name of the property
$value string The value of the property
Результат Scalr\Stats\CostAnalytics\Entity\CostCentreEntity

setCostCenter() публичный Метод

Sets a parent costcenter
public setCostCenter ( Scalr\Stats\CostAnalytics\Entity\CostCentreEntity $cc = null ) : ProjectEntity
$cc Scalr\Stats\CostAnalytics\Entity\CostCentreEntity
Результат ProjectEntity

setProperty() публичный Метод

Sets property with specified name
public setProperty ( string $name, string $value ) : Scalr\Stats\CostAnalytics\Entity\CostCentreEntity
$name string The unique name of the property
$value string The value of the property
Результат Scalr\Stats\CostAnalytics\Entity\CostCentreEntity

Описание свойств

$accountId публичное свойство

Global by default
public int $accountId
Результат integer

$archived публичное свойство

Whether the project has been archived
public bool $archived
Результат boolean

$ccId публичное свойство

Cost centre identifier (UUID)
public string $ccId
Результат string

$created публичное свойство

The date the record was created on
public DateTime $created
Результат DateTime

$createdByEmail публичное свойство

Email address of the user who created record
public string $createdByEmail
Результат string

$createdById публичное свойство

Identifier of the user who created this project
public int $createdById
Результат integer

$envId публичное свойство

It's used only in combination with share type - 3
public int $envId
Результат integer

$name публичное свойство

The name of the cost centre
public string $name
Результат string

$projectId публичное свойство

Project identifier (UUID)
public string $projectId
Результат string

$shared публичное свойство

Share type
public int $shared
Результат integer