PHP 클래스 Scalr\Api\Rest\Controller\ApiController

부터: 5.4.0 (12.02.2015)
저자: Vitaliy Demidov ([email protected])
상속: extends Scalr\Api\Rest\Controller\AbstractController
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$app Scalr\Api\Rest\ApiApplication Application instance

공개 메소드들

메소드 설명
__call ( $method, $args )
adapter ( string $name, string $scope = null, string $version = null ) : ApiEntityAdapter Gets a new Instance of the adapter
auditLog ( string $event, variadic $extra ) : boolean AuditLogger wrapper
checkPermissions ( $args ) Checks whether the authenticated user either is authorized to the specified object or has permission to ACL Role
checkScopedPermissions ( string $resourceMnemonic, string $permissionMnemonic = null ) Checks whether the authenticated user either is authorized has permission to ACL Role
getApplication ( ) : ApiApplication Gets Application
getBareId ( object $object, string $item = null ) : mixed Gets bare id from request object
getCommonQueryParams ( ) : array Gets common query parameters
getEnvironment ( ) : Environment Gets Environment from the current request
getMaxResults ( ) : integer Gets the maximum records per page
getPageNum ( ) : integer Gets the number of the page
getPageOffset ( ) : integer Gets the page offset
getPagination ( integer $foundRows ) : Scalr\Api\DataType\Pagination Gets pagination object
getScope ( ) : string Gets current API request scope
getScopeCriteria ( string $scope = null, $strictToScope = false ) : array Gets criteria corresponding current API request scope
getUser ( ) : User Gets authenticated user
hasPermissions ( ) : boolean Checks whether the authenticated user either is authorized to the specified object or has permission to ACL Role
params ( string $name = null, string $default = null ) : string | array Gets GET request parameter
result ( mixed $data ) : Scalr\Api\DataType\ResultEnvelope Gets result envelope for the response
resultList ( mixed $data, string | null $foundRows = null ) : Scalr\Api\DataType\ListResultEnvelope Gets the list result envelope for the response
setApplication ( ApiApplication $app ) : ApiController Sets API Application instance

비공개 메소드들

메소드 설명
generateLink ( array &$params, boolean $sort = false ) : string Generates link using specified query params
processCommonQueryParameters ( ) Processes and validates common query parameters from the request

메소드 상세

__call() 공개 메소드

public __call ( $method, $args )

adapter() 공개 메소드

Gets a new Instance of the adapter
public adapter ( string $name, string $scope = null, string $version = null ) : ApiEntityAdapter
$name string The name of the adapter
$scope string optional The scope of the adapter
$version string optional The version of the adapter
리턴 Scalr\Api\DataType\ApiEntityAdapter Returns the instance of the specified adapter

auditLog() 공개 메소드

AuditLogger wrapper
public auditLog ( string $event, variadic $extra ) : boolean
$event string Event name, aka tag
$extra variadic optional Array of additionally provided information
리턴 boolean Whether operation was successful

checkPermissions() 공개 메소드

checkPermissions(object $obj, bool $modify = false, $errorMessage='') checkPermissions(int $roleId, string $permissionId = null, $errorMessage='')
public checkPermissions ( $args )

checkScopedPermissions() 공개 메소드

Checks whether the authenticated user either is authorized has permission to ACL Role
public checkScopedPermissions ( string $resourceMnemonic, string $permissionMnemonic = null )
$resourceMnemonic string ACL resource name
$permissionMnemonic string optional ACL permission name

getApplication() 공개 메소드

Gets Application
public getApplication ( ) : ApiApplication
리턴 Scalr\Api\Rest\ApiApplication

getBareId() 공개 정적인 메소드

Gets bare id from request object
public static getBareId ( object $object, string $item = null ) : mixed
$object object Request object
$item string optional Item name (image, role) or null, if object is target
리턴 mixed

getCommonQueryParams() 공개 메소드

Gets common query parameters
public getCommonQueryParams ( ) : array
리턴 array Returns array of common query parameters looks like [name => value]

getEnvironment() 공개 메소드

Gets Environment from the current request
public getEnvironment ( ) : Environment
리턴 Scalr\Model\Entity\Account\Environment

getMaxResults() 공개 메소드

Gets the maximum records per page
public getMaxResults ( ) : integer
리턴 integer Returns maximum records per page

getPageNum() 공개 메소드

Gets the number of the page
public getPageNum ( ) : integer
리턴 integer Returns the number of the page

getPageOffset() 공개 메소드

Gets the page offset
public getPageOffset ( ) : integer
리턴 integer Returns page offset

getPagination() 공개 메소드

Gets pagination object
public getPagination ( integer $foundRows ) : Scalr\Api\DataType\Pagination
$foundRows integer The number of records found
리턴 Scalr\Api\DataType\Pagination Returns pagination object

getScope() 공개 메소드

Gets current API request scope
public getScope ( ) : string
리턴 string Returns scope

getScopeCriteria() 공개 메소드

Gets criteria corresponding current API request scope
public getScopeCriteria ( string $scope = null, $strictToScope = false ) : array
$scope string optional Scope override
리턴 array Returns criteria

getUser() 공개 메소드

Gets authenticated user
public getUser ( ) : User
리턴 Scalr\Model\Entity\Account\User

hasPermissions() 공개 메소드

hasPermissions(object $obj, bool $modify = false) hasPermissions(int $roleId, string $permissionId = null)
public hasPermissions ( ) : boolean
리턴 boolean Returns TRUE if the authenticated user has access or FALSE otherwise

params() 최종 공개 메소드

If common query parameter is used
final public params ( string $name = null, string $default = null ) : string | array
$name string The name of the parameter
$default string optional The default value of the parameter
리턴 string | array Returns the value of the param. If the name is not specified it returns all query params

result() 공개 메소드

Gets result envelope for the response
public result ( mixed $data ) : Scalr\Api\DataType\ResultEnvelope
$data mixed The response data
리턴 Scalr\Api\DataType\ResultEnvelope Returns result envelope object depends on specified data

resultList() 공개 메소드

Gets the list result envelope for the response
public resultList ( mixed $data, string | null $foundRows = null ) : Scalr\Api\DataType\ListResultEnvelope
$data mixed The list of the objects which should be responded with
$foundRows string | null optional The number of the found rows to inject Pagination into envelope
리턴 Scalr\Api\DataType\ListResultEnvelope Returns list result

setApplication() 공개 메소드

Sets API Application instance
public setApplication ( ApiApplication $app ) : ApiController
$app Scalr\Api\Rest\ApiApplication API Application instance
리턴 ApiController

프로퍼티 상세

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

Application instance
protected ApiApplication,Scalr\Api\Rest $app
리턴 Scalr\Api\Rest\ApiApplication