PHP 클래스 Scalr\Stats\CostAnalytics\Projects

부터: 5.0 (11.02.2014)
저자: Vitaliy Demidov ([email protected])
파일 보기 프로젝트 열기: scalr/scalr

보호된 프로퍼티들

프로퍼티 타입 설명
$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