PHP Класс Scalr_UI_Controller

Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$cryptoKey
$db ADODB_mysqli
$request Scalr_UI_Request
$response Scalr_UI_Response
$uiCacheKeyPattern string
$unusedPathChunks
$user Scalr_Account_User

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

Свойство Тип Описание
$_environment Scalr\Model\Entity\Account\Environment
$environment Scalr_Environment
$sortParams

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

Метод Описание
__construct ( )
addUiCacheKeyPatternChunk ( $chunk )
auditLog ( string $event, variadic $extra ) : boolean AuditLogger wrapper
call ( $pathChunks = [], $permissionFlag = true )
callActionMethod ( $method )
controller ( boolean $checkPermissions = false ) : Scalr_UI_Controller Create controller object from current class
getContainer ( ) : Container Gets DI Container
getEnvironment ( ) : Scalr_Environment Gets current environment
getEnvironmentEntity ( ) : Environment Get current environment as Entity
getEnvironmentId ( boolean $silent = false ) : integer Returns identifier of the current Environment which is selected by the User.
getParam ( string $key, boolean $rawValue = false ) : mixed
getUser ( ) : User | null Gets the User Entity for the current request
handleRequest ( $pathChunks )
hasAccess ( ) : boolean Restricts access to controller's actions
init ( )
loadController ( $controller, $prefix = 'Scalr_UI_Controller', $checkPermissions = false ) : Scalr_UI_Controller

Защищенные методы

Метод Описание
buildResponseFromData ( array $data, array $filterFields = [], boolean $ignoreLimit = false ) : array
buildResponseFromSql ( string $sql, array $filterFields = [], string $groupSQL = "", boolean | true $simpleQuery = true, boolean | false $noLimit = false ) : mixed
buildResponseFromSql2 ( $sql, $sortFields = [], $filterFields = [], $args = [], $noLimit = false )
getCrypto ( ) : Scalr\Util\CryptoTool
getSortOrder ( ) : array Parse and validate input parameter sort (json-encoded array), and return as array [[property, direction], .
sort ( $item1, $item2 )

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

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

public __construct ( )

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

public addUiCacheKeyPatternChunk ( $chunk )

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

buildResponseFromData() защищенный Метод

protected buildResponseFromData ( array $data, array $filterFields = [], boolean $ignoreLimit = false ) : array
$data array
$filterFields array New format: [field1 => query, ... ], old format: [field1, field2] For new format: - Conjuction: AND (all fields should be found) - Field could be list of fields ('field1,field2,field3'), in that case any of given fields should be found
$ignoreLimit boolean If true return all results
Результат array

buildResponseFromSql() защищенный Метод

Устаревший:
protected buildResponseFromSql ( string $sql, array $filterFields = [], string $groupSQL = "", boolean | true $simpleQuery = true, boolean | false $noLimit = false ) : mixed
$sql string
$filterFields array
$groupSQL string
$simpleQuery boolean | true
$noLimit boolean | false
Результат mixed

buildResponseFromSql2() защищенный Метод

protected buildResponseFromSql2 ( $sql, $sortFields = [], $filterFields = [], $args = [], $noLimit = false )

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

public call ( $pathChunks = [], $permissionFlag = true )

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

public callActionMethod ( $method )

controller() публичный статический Метод

Create controller object from current class
public static controller ( boolean $checkPermissions = false ) : Scalr_UI_Controller
$checkPermissions boolean
Результат Scalr_UI_Controller

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

Gets DI Container
public getContainer ( ) : Container
Результат Scalr\DependencyInjection\Container Returns DI Container

getCrypto() защищенный Метод

protected getCrypto ( ) : Scalr\Util\CryptoTool
Результат Scalr\Util\CryptoTool

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

Gets current environment
public getEnvironment ( ) : Scalr_Environment
Результат Scalr_Environment

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

Get current environment as Entity
public getEnvironmentEntity ( ) : Environment
Результат Scalr\Model\Entity\Account\Environment Current environment

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

If environment hasn't been set it will throw an exception unless silent is turned on.
public getEnvironmentId ( boolean $silent = false ) : integer
$silent boolean optional On false throw Exception
Результат integer Returns identifier of the Environment

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

Устаревший:
public getParam ( string $key, boolean $rawValue = false ) : mixed
$key string
$rawValue boolean if true returns rawValue (not stripped) only once, don't save in cache
Результат mixed

getSortOrder() защищенный Метод

..]
protected getSortOrder ( ) : array
Результат array Array of sort orders [[property => '', direction => '']]

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

Gets the User Entity for the current request
public getUser ( ) : User | null
Результат Scalr\Model\Entity\Account\User | null Returns the User entity for the current Request

handleRequest() публичный статический Метод

public static handleRequest ( $pathChunks )

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

Restricts access to controller's actions
public hasAccess ( ) : boolean
Результат boolean Returns true if user has access.

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

public init ( )

loadController() публичный статический Метод

public static loadController ( $controller, $prefix = 'Scalr_UI_Controller', $checkPermissions = false ) : Scalr_UI_Controller
Результат Scalr_UI_Controller

sort() защищенный Метод

protected sort ( $item1, $item2 )

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

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

protected Environment,Scalr\Model\Entity\Account $_environment
Результат Scalr\Model\Entity\Account\Environment

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

public $cryptoKey

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

public ADODB_mysqli $db
Результат ADODB_mysqli

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

protected Scalr_Environment $environment
Результат Scalr_Environment

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

public Scalr_UI_Request $request
Результат Scalr_UI_Request

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

public Scalr_UI_Response $response
Результат Scalr_UI_Response

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

protected $sortParams

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

public string $uiCacheKeyPattern
Результат string

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

public $unusedPathChunks

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

public Scalr_Account_User $user
Результат Scalr_Account_User