PHP Класс Scalr\Stats\CostAnalytics\Projects

С версии: 5.0 (11.02.2014)
Автор: Vitaliy Demidov ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$collection Scalr\Model\Collections\ArrayCollection
$db ADODB_mysqli Database connection instance

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

Метод Описание
__construct ( ADODB_mysqli $db ) Constructor
all ( boolean $ignoreCache = false, array $criteria = null ) : ArrayCollection Gets all projects
checkPermission ( string $projectId, array $criteria ) : boolean | mixed Checks if user has permissions to project in environment or account scope
findByKey ( string $key = null, array $criteria = null, $ignoreCache = false ) : ArrayCollection Finds projects by key It searches by name or billing number
get ( string $projectId, boolean $ignoreCache = false, array $criteria = null ) : ProjectEntity Gets a specified project
getAccountProjects ( integer $accountId, string $query = null ) : ArrayCollection Gets available projects for account scope
getFarmsList ( string $projectId ) : array Get the list of the farms which are assigned to specified project
getUsedInEnvironment ( integer $envId ) : array Gets the list of projects within environment

Приватные методы

Метод Описание
parseFindCriteria ( array $criteria, string &$join, string &$where ) Parses common criteria

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

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

Constructor
public __construct ( ADODB_mysqli $db )
$db ADODB_mysqli Database connection instance

all() публичный метод

It returns projects with all properties by one query
public all ( boolean $ignoreCache = false, array $criteria = null ) : ArrayCollection
$ignoreCache boolean optional Should it ignore cache or not
$criteria array optional Search criteria ['envId' => '', 'accountId' => '', 'accountId' => '']
Результат Scalr\Model\Collections\ArrayCollection Returns collection of all ProjectEntity objects

checkPermission() публичный метод

Checks if user has permissions to project in environment or account scope
public checkPermission ( string $projectId, array $criteria ) : boolean | mixed
$projectId string Identifier of the project
$criteria array ['envId' => '', 'clientid' => '']
Результат boolean | mixed

findByKey() публичный метод

Finds projects by key It searches by name or billing number
public findByKey ( string $key = null, array $criteria = null, $ignoreCache = false ) : ArrayCollection
$key string optional Search key
$criteria array optional Search criteria ['envId' => '', 'accountId' => '', 'accountId' => '']
Результат Scalr\Model\Collections\ArrayCollection Returns collection of the ProjectEntity objects

get() публичный метод

Gets a specified project
public get ( string $projectId, boolean $ignoreCache = false, array $criteria = null ) : ProjectEntity
$projectId string The identifier of the project
$ignoreCache boolean optional Should it ignore cache or not
$criteria array optional Search criteria ['envId' => '', 'accountId' => '']
Результат Scalr\Stats\CostAnalytics\Entity\ProjectEntity Returns the ProjectEntity on success or null if it does not exist.

getAccountProjects() публичный метод

Gets available projects for account scope
public getAccountProjects ( integer $accountId, string $query = null ) : ArrayCollection
$accountId integer Current user object
$query string optional Search criteria
Результат Scalr\Model\Collections\ArrayCollection

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

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

getUsedInEnvironment() публичный метод

Gets the list of projects within environment
public getUsedInEnvironment ( integer $envId ) : array
$envId integer Identifier of the Environment
Результат array Returns array of the ProjectEntity objects

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

$collection защищенное свойство

protected ArrayCollection,Scalr\Model\Collections $collection
Результат Scalr\Model\Collections\ArrayCollection

$db защищенное свойство

Database connection instance
protected ADODB_mysqli $db
Результат ADODB_mysqli