ActionQuery
in package
Table of Contents
Properties
- $blockSqlWords : mixed
- $appContext : AppContextInterface
- $cnx : jDbConnection
- $layerId : string
- $project : string
- $repository : string
Methods
- __construct() : mixed
- buildParams() : array<string, null|int|string>
- Build the parameter array passed as a JSON object to lizmap_get_data.
- buildSql() : array{0: string, 1: list}
- Build the SQL string and the ordered values list for the prepared statement.
- execute() : mixed
- Execute the prepared statement inside a transaction and return the decoded data.
-
validateActionParameterString()
: array{0: bool, 1: list
} - Validate an string given in action parameter.
Properties
$blockSqlWords
protected
static mixed
$blockSqlWords
= array(';', 'select', 'delete', 'insert', 'update', 'drop', 'alter', '--', 'truncate', 'vacuum', 'create', 'reindex', 'grant', 'revoke', '/*')
$appContext
private
AppContextInterface
$appContext
$cnx
private
jDbConnection
$cnx
$layerId
private
string
$layerId
$project
private
string
$project
$repository
private
string
$repository
Methods
__construct()
public
__construct(mixed $cnx, string $repository, string $project, string $layerId, AppContextInterface $appContext) : mixed
Parameters
- $cnx : mixed
- $repository : string
- $project : string
- $layerId : string
- $appContext : AppContextInterface
buildParams()
Build the parameter array passed as a JSON object to lizmap_get_data.
public
buildParams(string $actionName, string $scope, null|qgisVectorLayer $qgisLayer, int|string $featureId, string $wkt, string $mapCenter, string $mapExtent) : array<string, null|int|string>
Parameters
- $actionName : string
- $scope : string
-
project|layer|feature
- $qgisLayer : null|qgisVectorLayer
- $featureId : int|string
- $wkt : string
- $mapCenter : string
- $mapExtent : string
Return values
array<string, null|int|string>buildSql()
Build the SQL string and the ordered values list for the prepared statement.
public
buildSql(array<string, null|int|string> $params, object $action, array<string, mixed> $clientOptions) : array{0: string, 1: list}
Parameters
- $params : array<string, null|int|string>
-
Output of buildParams()
- $action : object
-
Action config object (must expose ->options)
- $clientOptions : array<string, mixed>
-
Options sent by the client
Return values
array{0: string, 1: list} —[$sql, $sqlValues]
execute()
Execute the prepared statement inside a transaction and return the decoded data.
public
execute(string $sql, array<int, mixed> $sqlValues) : mixed
Parameters
- $sql : string
- $sqlValues : array<int, mixed>
Tags
Return values
mixed —Decoded JSON data returned by lizmap_get_data
validateActionParameterString()
Validate an string given in action parameter.
private
validateActionParameterString(string $filter) : array{0: bool, 1: list}
The string are already used in prepared statements but we still restrain some unwanted chars
Parameters
- $filter : string
-
The content to validate
Return values
array{0: bool, 1: listreturns if the string does not contain unwanted chars, and the list of blocked items