Statement
in package
implements
StatementInterface
Represents a prepared AQL Statement
Tags
Table of Contents
Interfaces
- StatementInterface
- StatementInterface
Properties
- $collectionAlias : string
- If the statement use an alias for collection, store the alias here (e.g "@collection", "@coll")
- $container : BindContainer
- Contains all references calling 'bindValue' method
- $formats : array<string|int, mixed>
- Formats to format output string
- $query : string
- The query string
- $queryParameters : array<string|int, mixed>
- Parameters set with '@' in query
- $validator : ValidatorInterface
- Validator for binding values or params
Methods
- __construct() : mixed
- Statement constructor.
- __toString() : string
- String representation of query
- bindValue() : bool
- Binds a value to specified parameter name.
- getBindVars() : array<string|int, mixed>
- Get the bind vars
- getQuery() : string
- Returns the query string
- hasAliases() : bool
- If the query has some alias on it to receive an value after through binding
- toAql() : string
- 'Resolves' the query, returning the string after bind all params and values
- hasParam() : bool
- Check if parameter exists
- isCollectionAlias() : bool
- Verify if an alias is defined for collection aliasing
- output() : string
- Returns the proper output formatted given parameter
- processQueryParameters() : void
- Find occurrences of bind params in query string
Properties
$collectionAlias
If the statement use an alias for collection, store the alias here (e.g "@collection", "@coll")
protected
string
$collectionAlias
= ""
$container
Contains all references calling 'bindValue' method
protected
BindContainer
$container
$formats
Formats to format output string
protected
array<string|int, mixed>
$formats
= ["float" => "%F", "integer" => "%d", "string" => "'%s'", "boolean" => "%s", "collection" => "%s"]
$query
The query string
protected
string
$query
$queryParameters
Parameters set with '@' in query
protected
array<string|int, mixed>
$queryParameters
= []
$validator
Validator for binding values or params
protected
ValidatorInterface
$validator
Methods
__construct()
Statement constructor.
public
__construct(string $query) : mixed
Parameters
- $query : string
-
AQL query string.
__toString()
String representation of query
public
__toString() : string
Return values
stringbindValue()
Binds a value to specified parameter name.
public
bindValue(string $parameter, mixed $value) : bool
Parameters
- $parameter : string
-
Parameter name.
- $value : mixed
-
Value for parameter.
Tags
Return values
bool —True if the parameter has an alias on query string. False otherwise.
getBindVars()
Get the bind vars
public
getBindVars() : array<string|int, mixed>
Return values
array<string|int, mixed>getQuery()
Returns the query string
public
getQuery() : string
Return values
stringhasAliases()
If the query has some alias on it to receive an value after through binding
public
hasAliases() : bool
Return values
booltoAql()
'Resolves' the query, returning the string after bind all params and values
public
toAql() : string
Tags
Return values
stringhasParam()
Check if parameter exists
private
hasParam(string $parameter) : bool
Parameters
- $parameter : string
-
Parameter name.
Return values
boolisCollectionAlias()
Verify if an alias is defined for collection aliasing
private
isCollectionAlias([string $alias = "@collection" ]) : bool
Parameters
- $alias : string = "@collection"
-
The candidate alias to be checked.
Return values
booloutput()
Returns the proper output formatted given parameter
private
output(string $parameter) : string
Parameters
- $parameter : string
-
Parameter name.
Return values
stringprocessQueryParameters()
Find occurrences of bind params in query string
private
processQueryParameters() : void