PHP Class Scalr_UI_Controller

Afficher le fichier Open project: scalr/scalr Class Usage Examples

Méthodes publiques

Свойство Type Description
$cryptoKey
$db ADODB_mysqli
$request Scalr_UI_Request
$response Scalr_UI_Response
$uiCacheKeyPattern string
$unusedPathChunks
$user Scalr_Account_User

Protected Properties

Свойство Type Description
$_environment Scalr\Model\Entity\Account\Environment
$environment Scalr_Environment
$sortParams

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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 )

Method Details

__construct() public méthode

public __construct ( )

addUiCacheKeyPatternChunk() public méthode

public addUiCacheKeyPatternChunk ( $chunk )

auditLog() public méthode

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

buildResponseFromData() protected méthode

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
Résultat array

buildResponseFromSql() protected méthode

Deprecation:
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
Résultat mixed

buildResponseFromSql2() protected méthode

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

call() public méthode

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

callActionMethod() public méthode

public callActionMethod ( $method )

controller() public static méthode

Create controller object from current class
public static controller ( boolean $checkPermissions = false ) : Scalr_UI_Controller
$checkPermissions boolean
Résultat Scalr_UI_Controller

getContainer() public méthode

Gets DI Container
public getContainer ( ) : Container
Résultat Scalr\DependencyInjection\Container Returns DI Container

getCrypto() protected méthode

protected getCrypto ( ) : Scalr\Util\CryptoTool
Résultat Scalr\Util\CryptoTool

getEnvironment() public méthode

Gets current environment
public getEnvironment ( ) : Scalr_Environment
Résultat Scalr_Environment

getEnvironmentEntity() public méthode

Get current environment as Entity
public getEnvironmentEntity ( ) : Environment
Résultat Scalr\Model\Entity\Account\Environment Current environment

getEnvironmentId() public méthode

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
Résultat integer Returns identifier of the Environment

getParam() public méthode

Deprecation:
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
Résultat mixed

getSortOrder() protected méthode

..]
protected getSortOrder ( ) : array
Résultat array Array of sort orders [[property => '', direction => '']]

getUser() public méthode

Gets the User Entity for the current request
public getUser ( ) : User | null
Résultat Scalr\Model\Entity\Account\User | null Returns the User entity for the current Request

handleRequest() public static méthode

public static handleRequest ( $pathChunks )

hasAccess() public méthode

Restricts access to controller's actions
public hasAccess ( ) : boolean
Résultat boolean Returns true if user has access.

init() public méthode

public init ( )

loadController() public static méthode

public static loadController ( $controller, $prefix = 'Scalr_UI_Controller', $checkPermissions = false ) : Scalr_UI_Controller
Résultat Scalr_UI_Controller

sort() protected méthode

protected sort ( $item1, $item2 )

Property Details

$_environment protected_oe property

protected Environment,Scalr\Model\Entity\Account $_environment
Résultat Scalr\Model\Entity\Account\Environment

$cryptoKey public_oe property

public $cryptoKey

$db public_oe property

public ADODB_mysqli $db
Résultat ADODB_mysqli

$environment protected_oe property

protected Scalr_Environment $environment
Résultat Scalr_Environment

$request public_oe property

public Scalr_UI_Request $request
Résultat Scalr_UI_Request

$response public_oe property

public Scalr_UI_Response $response
Résultat Scalr_UI_Response

$sortParams protected_oe property

protected $sortParams

$uiCacheKeyPattern public_oe property

public string $uiCacheKeyPattern
Résultat string

$unusedPathChunks public_oe property

public $unusedPathChunks

$user public_oe property

public Scalr_Account_User $user
Résultat Scalr_Account_User