Construct a complex SQL expression
| package | salt\sql |
|---|---|
| inherited_from | \salt\SqlBindField |
asBoolean() : \salt\SqlExpr
\salt\SqlExprcurrent objectasDate(string $format = NULL) : \salt\SqlExpr
stringformat of the source, used for convert to date.
\Exception |
|---|
\salt\SqlExprcurrent objectasNumber() : \salt\SqlExpr
\salt\SqlExprcurrent objectasSetter(\salt\Field $field) : \salt\SqlExpr
\salt\Fieldthe field to use for configure SqlExpr
\salt\SqlExprcurrent objectasText() : \salt\SqlExpr
\salt\SqlExprcurrent objectasTimestamp(string $format = NULL) : \salt\SqlExpr
stringformat of the source, used for convert to date.
\Exception |
|---|
\salt\SqlExprcurrent objectdistinct() : \salt\SqlExpr
\salt\SqlExprcurrent objectfield(string $alias, \salt\Field $field) : \salt\SqlExpr
Do not use this method, but Query::getField($fieldName) instead
stringalias of the table of the field
\salt\Fieldfield
\salt\SqlExprfunc(string $name, \salt\SqlExpr $args = NULL) : \salt\SqlExpr
stringname of the function
\salt\SqlExpr... $args list of function arguments.
\salt\SqlExprgetAllUsedTableAlias() : 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
stringthe field name if SqlExpr is a FIELD expr, NULL otherwisegetType() : integer
integerFieldType the type of the SqlExprnot() : \salt\SqlExpr
\salt\SqlExprcurrent objectplus(integer $value = 1) : \salt\SqlExpr
integervalue to increment (if positive) or decrement (if negative)
\salt\SqlExprcurrent objecttemplate(string $template, array<mixed,\salt\SqlExpr> $args = array()) : \salt\SqlExpr
stringtemplate with TEMPLATE_MAIN and TEMPLATE_PARAM if necessary
array<mixed,\salt\SqlExpr>list of parameters
\salt\SqlExprcurrent objecttoSQL() : string
stringthe SQL text for SqlExprvalue(mixed $value) : \salt\SqlExpr
mixedvalue to transform in SqlExpr. Can be NULL
\salt\SqlExpr__construct(integer $objectType, mixed $data)
integertype of SqlExpr : FUNC|VALUE|FIELD
mixedsource of SqlExpr, can be a scalar value or an array
addBind(mixed $value, integer $type) : string
mixedvalue of bind
integer(FieldType) type of the field
stringthe bind namegetTemplateForConvertSqlDate(string $origin, string $destination) : string
stringorigin date format
stringdestination date format
stringtemplate 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
NULLFIELD = 2
FUNC = 0
TEMPLATE_MAIN = "\1:main\2"
TEMPLATE_PARAM = "\3?\4"
VALUE = 1