Arango PHP ODM

Statement
in package
implements StatementInterface

Represents a prepared AQL Statement

Tags
author

Lucas S. Vieira

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 = ""

$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 = []

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
string

bindValue()

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
throws
InvalidParameterException
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
string

hasAliases()

If the query has some alias on it to receive an value after through binding

public hasAliases() : bool
Return values
bool

toAql()

'Resolves' the query, returning the string after bind all params and values

public toAql() : string
Tags
throws
StatementException
Return values
string

hasParam()

Check if parameter exists

private hasParam(string $parameter) : bool
Parameters
$parameter : string

Parameter name.

Return values
bool

isCollectionAlias()

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
bool

output()

Returns the proper output formatted given parameter

private output(string $parameter) : string
Parameters
$parameter : string

Parameter name.

Return values
string

processQueryParameters()

Find occurrences of bind params in query string

private processQueryParameters() : void

        
On this page

Search results