protected QueryType $type = 'QueryType'
protected array $selectGroups
protected string $quoteSpecial = '"'
protected array $reservedWords
The list of columns to select in the query.
This array holds the column names or expressions that will be included in the SELECT clause of the generated SQL statement.
The fields to update or insert.
This can be a bunch of things, like an array, strings, Table or even a Model or stdClass.
protected array $primaryTable
protected mixed $returning
public null $conflictTarget
public null $conflictUpdate
public string $schemaName
private array $valueIndex
public __construct(?string $schemaName): void
| Parameter | Type | Description |
|---|
$schemaName | string | |
public __toString(): string
public setReservedWords(array $words): void
| Parameter | Type | Description |
|---|
$words | array | |
public getSchemaName(): ?string
public parseSchemaName(string $tableName): void
| Parameter | Type | Description |
|---|
$tableName | string | |
public schemaName(string $tableName): string
| Parameter | Type | Description |
|---|
$tableName | string | |
public quote(string $string, bool $addSlashes = true): string
| Parameter | Type | Description |
|---|
$string | string | |
$addSlashes | bool | |
public quoteSpecial(mixed $value): mixed
| Parameter | Type | Description |
|---|
$value | mixed | |
public create(string $name, string $type, bool $ifNotExists): string
| Parameter | Type | Description |
|---|
$name | string | |
$type | string | |
$ifNotExists | bool | |
public insert(mixed $fields): self
| Parameter | Type | Description |
|---|
$fields | mixed | |
public update(array $fields): self
| Parameter | Type | Description |
|---|
$fields | array | |
public truncate(bool $cascade): self
| Parameter | Type | Description |
|---|
$cascade | bool | |
public exists(string $tableName, mixed $criteria): string
| Parameter | Type | Description |
|---|
$tableName | string | |
$criteria | mixed | |
public select(mixed $columns): self
| Parameter | Type | Description |
|---|
$columns | mixed | |
Selects only distinct rows that match based on the specified expressions.
public distinct(string $columns): self
| Parameter | Type | Description |
|---|
$columns | string | |
public from(string $table, ?string $alias): self
| Parameter | Type | Description |
|---|
$table | string | |
$alias | string | |
Sets the primary table to use for INSERT, UPDATE or DELETE.
public table(string $table, ?string $alias): self
| Parameter | Type | Description |
|---|
$table | string | The name of the table |
$alias | string | An optional alias for the table |
Defines a WHERE selection criteria.
public where(string $criteria): self
| Parameter | Type | Description |
|---|
$criteria | string | |
public group(string $columns): self
| Parameter | Type | Description |
|---|
$columns | string | |
public having(array $columns): self
| Parameter | Type | Description |
|---|
$columns | array | |
public window(string $name, string $partitionBy, null $orderBy): self
| Parameter | Type | Description |
|---|
$name | string | |
$partitionBy | string | |
$orderBy | null | |
public join(string $references, null $on, ?string $alias, string $type = 'INNER'): self
| Parameter | Type | Description |
|---|
$references | string | |
$on | null | |
$alias | string | |
$type | string | |
public union(QueryBuilder $query): self
| Parameter | Type | Description |
|---|
$query | QueryBuilder | |
public unionAll(QueryBuilder $query): QueryBuilder
| Parameter | Type | Description |
|---|
$query | QueryBuilder | |
public intersect(QueryBuilder $query): self
| Parameter | Type | Description |
|---|
$query | QueryBuilder | |
public except(QueryBuilder $query): self
| Parameter | Type | Description |
|---|
$query | QueryBuilder | |
public order(string $fieldDef, int $sortDirection = 'SORT_ASC'): self
| Parameter | Type | Description |
|---|
$fieldDef | string | |
$sortDirection | int | |
public limit(?int $limit): self
| Parameter | Type | Description |
|---|
$limit | int | |
public offset(?int $offset): self
| Parameter | Type | Description |
|---|
$offset | int | |
Return the current selection as a valid SQL string.
public toString(bool $terminateWithColon): string
| Parameter | Type | Description |
|---|
$terminateWithColon | bool | |
public field(string $string): string
| Parameter | Type | Description |
|---|
$string | string | |
public prepareFields(mixed $fields, array $exclude, array $tables): string
| Parameter | Type | Description |
|---|
$fields | mixed | |
$exclude | array | |
$tables | array | |
public prepareValue(string $key, mixed $value): mixed
| Parameter | Type | Description |
|---|
$key | string | |
$value | mixed | |
public prepareArrayAliases(array $array): void
| Parameter | Type | Description |
|---|
$array | array | |
public prepareCriteria(string $criteria, string $bindType = 'AND', string $tissue = '=', ?string $parentRef, bool $setKey = true, int $depth): string
| Parameter | Type | Description |
|---|
$criteria | string | |
$bindType | string | |
$tissue | string | |
$parentRef | string | |
$setKey | bool | |
$depth | int | |
Retrieves the criteria values by combining the provided parameter values with the default values.
public getCriteriaValues(): void
Iterates over the internal value index and, for each key and its associated values, constructs a criteria value array. If a value for the key exists in the provided $paramValues array, it is used; otherwise, the default value is used.
Prepares criteria values for use in SQL queries by mapping parameter values to indexed keys.
public prepareCriteriaValues(array $paramValues): void
| Parameter | Type | Description |
|---|
$paramValues | array | |
public returning(mixed $columns): self
| Parameter | Type | Description |
|---|
$columns | mixed | |
public onConflict(null $target, null $update): self
| Parameter | Type | Description |
|---|
$target | null | |
$update | null | |
private prepareValueAction(string $action, mixed $value): mixed
| Parameter | Type | Description |
|---|
$action | string | |
$value | mixed | |
private prepareCriteriaAction(string $action, mixed $value, string $key, ?string $tissue = '=', bool $setKey = true, int $depth, null $): void
| Parameter | Type | Description |
|---|
$action | string | |
$value | mixed | |
$key | string | |
$tissue | string | |
$setKey | bool | |
$depth | int | |
$ | null | |
private prepareOrder(string $orderDefinition): string
| Parameter | Type | Description |
|---|
$orderDefinition | string | |
private toSELECTString(): string
private toINSERTString(): string
private toUPDATEString(): string
private toDELETEString(): string
private toTRUNCATEString(): string
Generated by Hazaar API Doc Generator on Sun, 01 Mar 2026 09:22:25 +0000