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\Base
object or array of object (of same type) to insert
__construct(\salt\Base $obj)
\salt\Base
the object is used for retrieve metadata.
getBinds() : array<mixed,mixed[]>
array<mixed,mixed[]>
list of binds : array of array('value' => ..., 'type' => ...)getInsertObjectCount() : integer
integer
the number of expected objects to inserttoCountSQL() : string
Have to be overrided by child classes if needed
\salt\SaltException |
if called |
---|
string
the SQL text for count querytoSQL(\salt\Pagination $pagination = NULL
)
toSQL(\salt\Pagination $pagination = NULL
) : string
\salt\Pagination
the object for handle paging
string
the SQL text of the query with bind placeholdersaddBind(mixed $value, integer $type) : string
mixed
value of bind
integer
(FieldType) type of the field
string
the bind nameaddBindsSource(string $source, string|array<mixed,string> $binds)
string
caller of bind (SELECT, WHERE, GROUPBY, etc...)
string
array<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>
string
caller of resolve : SELECT, WHERE, etc...
mixed
\salt\SqlExpr
a FieldName (string) or SqlExpr or potential value (int, string, array) if 3rd argument is provided
mixed
\salt\SqlExpr
a Field related to the value. Can be a SqlExpr or a string. Can be NULL if 2nd argument is a string fieldName
string
array<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
string
source of bind
mixed
a value for bind
integer
FieldType
string
the bind added or replacedgetFieldType(string $field) : integer
string
the fieldName
integer
FiedType 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 |
---|