Query for INSERT
| package | salt\sql\queries |
|---|---|
| inherited_from | \salt\BaseQuery |
__construct(array<mixed,\salt\Base>|\salt\Base $objects)
| inherited_from | \salt\BaseQuery::__construct() |
|---|
array<mixed,\salt\Base>\salt\Baseobject or array of object (of same type) to insert
__construct(\salt\Base $obj)
\salt\Basethe object is used for retrieve metadata.
getBinds() : array<mixed,mixed[]>
array<mixed,mixed[]>list of binds : array of array('value' => ..., 'type' => ...)getInsertObjectCount() : integer
integerthe number of expected objects to inserttoCountSQL() : string
Have to be overrided by child classes if needed
\salt\SaltException |
if called |
|---|
stringthe SQL text for count querytoSQL(\salt\Pagination $pagination = NULL)
toSQL(\salt\Pagination $pagination = NULL) : string
\salt\Paginationthe object for handle paging
stringthe SQL text of the query with bind placeholdersaddBind(mixed $value, integer $type) : string
mixedvalue of bind
integer(FieldType) type of the field
stringthe bind nameaddBindsSource(string $source, string|array<mixed,string> $binds)
stringcaller of bind (SELECT, WHERE, GROUPBY, etc...)
stringarray<mixed,string>bind name or list of binds name
getBindsBySource(string $sources) : array<mixed,string>
string... $sources function take unlimited source bind parameters
array<mixed,string>binds registered with theses sourcesresolveFieldName(string $source, mixed|\salt\SqlExpr $fieldNameOrValue, mixed|\salt\SqlExpr $fieldOfValue = NULL) : string | array<mixed,string>
stringcaller of resolve : SELECT, WHERE, etc...
mixed\salt\SqlExpra FieldName (string) or SqlExpr or potential value (int, string, array) if 3rd argument is provided
mixed\salt\SqlExpra Field related to the value. Can be a SqlExpr or a string. Can be NULL if 2nd argument is a string fieldName
stringarray<mixed,string>absolute field name (alias.fieldname) or string with bind values or array of bind values if 2nd argument is an array of valuessetOrRemplaceBind(string $source, mixed $value, integer $type) : string
Only work with 1 bind by source name
stringsource of bind
mixeda value for bind
integerFieldType
stringthe bind added or replacedgetFieldType(string $field) : integer
stringthe fieldName
integerFiedType type of the field$bindNumber : integer
0$binds : array<mixed,mixed>
array()| content | array of bindName => array( 'value' => mixed // value of bind 'type' => int FieldType // type of field ) |
|---|
$bindsSource : \salt\binds
array()| content | array of source => array(binds) |
|---|
$obj : \salt\Base
$fields : array<mixed,string>
array()$objects : array<mixed,\salt\Base>
$sets : array<mixed,string[]>
array()| content | array of array of field=>bind |
|---|