ArrayExpressionBuilder
in package
implements
ExpressionBuilderInterface
uses
ExpressionBuilderTrait
Class ArrayExpressionBuilder builds [[ArrayExpression]] for PostgreSQL DBMS.
Tags
Table of Contents
Interfaces
- ExpressionBuilderInterface
- Interface ExpressionBuilderInterface is designed to build raw SQL from specific expression objects that implement [[ExpressionInterface]].
Properties
Methods
- __construct() : mixed
- ExpressionBuilderTrait constructor.
- build() : string
- Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.
- buildPlaceholders() : array<string|int, mixed>
- Builds placeholders array out of $expression values
- buildSubqueryArray() : string
- Build an array expression from a subquery SQL.
- getTypehint() : string
- typecastValue() : JsonExpression
- Casts $value to use in $expression
- unnestArrayExpression() : ArrayExpression
Properties
$queryBuilder
protected
QueryBuilder
$queryBuilder
Methods
__construct()
ExpressionBuilderTrait constructor.
public
__construct(QueryBuilder $queryBuilder) : mixed
Parameters
- $queryBuilder : QueryBuilder
build()
Method builds the raw SQL from the $expression that will not be additionally escaped or quoted.
public
build(ArrayExpression|ExpressionInterface $expression[, array<string|int, mixed> &$params = [] ]) : string
Parameters
- $expression : ArrayExpression|ExpressionInterface
-
the expression to be built
- $params : array<string|int, mixed> = []
-
the binding parameters.
Return values
string —the raw SQL that will not be additionally escaped or quoted.
buildPlaceholders()
Builds placeholders array out of $expression values
protected
buildPlaceholders(ExpressionInterface|ArrayExpression $expression, array<string|int, mixed> &$params) : array<string|int, mixed>
Parameters
- $expression : ExpressionInterface|ArrayExpression
- $params : array<string|int, mixed>
-
the binding parameters.
Return values
array<string|int, mixed>buildSubqueryArray()
Build an array expression from a subquery SQL.
protected
buildSubqueryArray(string $sql, ArrayExpression $expression) : string
Parameters
- $sql : string
-
the subquery SQL.
- $expression : ArrayExpression
Return values
string —the subquery array expression.
getTypehint()
protected
getTypehint(ArrayExpression $expression) : string
Parameters
- $expression : ArrayExpression
Return values
string —the typecast expression based on [[type]].
typecastValue()
Casts $value to use in $expression
protected
typecastValue(ArrayExpression $expression, mixed $value) : JsonExpression
Parameters
- $expression : ArrayExpression
- $value : mixed
Return values
JsonExpressionunnestArrayExpression()
private
unnestArrayExpression(ArrayExpression $expression, mixed $value) : ArrayExpression
Parameters
- $expression : ArrayExpression
- $value : mixed