Construct a complex SQL expression
package | salt\sql |
---|---|
inherited_from | \salt\SqlBindField |
asBoolean() : \salt\SqlExpr
\salt\SqlExpr
current objectasDate(string $format = NULL
) : \salt\SqlExpr
string
format of the source, used for convert to date.
\Exception |
---|
\salt\SqlExpr
current objectasNumber() : \salt\SqlExpr
\salt\SqlExpr
current objectasSetter(\salt\Field $field) : \salt\SqlExpr
\salt\Field
the field to use for configure SqlExpr
\salt\SqlExpr
current objectasText() : \salt\SqlExpr
\salt\SqlExpr
current objectasTimestamp(string $format = NULL
) : \salt\SqlExpr
string
format of the source, used for convert to date.
\Exception |
---|
\salt\SqlExpr
current objectdistinct() : \salt\SqlExpr
\salt\SqlExpr
current objectfield(string $alias, \salt\Field $field) : \salt\SqlExpr
Do not use this method, but Query::getField($fieldName) instead
string
alias of the table of the field
\salt\Field
field
\salt\SqlExpr
func(string $name, \salt\SqlExpr $args = NULL
) : \salt\SqlExpr
string
name of the function
\salt\SqlExpr
... $args list of function arguments.
\salt\SqlExpr
getAllUsedTableAlias() : array<mixed,string>
array<mixed,string>
all table aliasgetBinds() : array<mixed,mixed[]>
array<mixed,mixed[]>
list of binds : array of array('value' => ..., 'type' => ...)getFieldName() : string
string
the field name if SqlExpr is a FIELD expr, NULL otherwisegetType() : integer
integer
FieldType the type of the SqlExprnot() : \salt\SqlExpr
\salt\SqlExpr
current objectplus(integer $value = 1
) : \salt\SqlExpr
integer
value to increment (if positive) or decrement (if negative)
\salt\SqlExpr
current objecttemplate(string $template, array<mixed,\salt\SqlExpr> $args = array()
) : \salt\SqlExpr
string
template with TEMPLATE_MAIN and TEMPLATE_PARAM if necessary
array<mixed,\salt\SqlExpr>
list of parameters
\salt\SqlExpr
current objecttoSQL() : string
string
the SQL text for SqlExprvalue(mixed $value) : \salt\SqlExpr
mixed
value to transform in SqlExpr. Can be NULL
\salt\SqlExpr
__construct(integer $objectType, mixed $data)
integer
type of SqlExpr : FUNC|VALUE|FIELD
mixed
source of SqlExpr, can be a scalar value or an array
addBind(mixed $value, integer $type) : string
mixed
value of bind
integer
(FieldType) type of the field
string
the bind namegetTemplateForConvertSqlDate(string $origin, string $destination) : string
string
origin date format
string
destination date format
string
template for conversion, with ? as placeholder$bindNumber : integer
0
$binds : array<mixed,mixed>
array()
content | array of bindName => array( 'value' => mixed // value of bind 'type' => int FieldType // type of field ) |
---|
$data : mixed
NULL
$dateFormat : string
NULL
$objectType : integer
NULL
$setter : \salt\Field
NULL
$sqlText : string
NULL
$template : array<mixed,string>
array()
content | array of (template, param1, param2, ...) |
---|
$type : integer
NULL
FIELD = 2
FUNC = 0
TEMPLATE_MAIN = "\1:main\2"
TEMPLATE_PARAM = "\3?\4"
VALUE = 1