private QueryBuilder $queryBuilder
public __construct(Adapter $adapter, string $name, ?string $alias): void
Parameter | Type | Description |
---|
$adapter | Adapter | |
$name | string | |
$alias | string | |
public __toString(): string
public toString(): string
public exists(mixed $criteria): bool
Parameter | Type | Description |
---|
$criteria | mixed | |
public select(mixed $columns = '*'): self
Parameter | Type | Description |
---|
$columns | mixed | |
public distinct(string $columns): self
Parameter | Type | Description |
---|
$columns | string | |
public limit(int $limit): self
Parameter | Type | Description |
---|
$limit | int | |
public offset(int $offset): self
Parameter | Type | Description |
---|
$offset | int | |
public order(string $columns, int $direction = 'SORT_ASC'): self
Parameter | Type | Description |
---|
$columns | string | |
$direction | int | |
public group(string $columns): self
Parameter | Type | Description |
---|
$columns | string | |
public having(string $having): self
Parameter | Type | Description |
---|
$having | string | |
Join a table to the current query using the provided join criteria.
public join(string $table, string $on, ?string $alias, string $type = 'INNER'): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
$type | string | the join type such as INNER, OUTER, LEFT, RIGHT, etc |
Join a table to the current query using the provided join criteria.
public leftJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Join a table to the current query using the provided join criteria.
public rightJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Join a table to the current query using the provided join criteria.
public innerJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Join a table to the current query using the provided join criteria.
public outerJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Join a table to the current query using the provided join criteria.
public fullJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Join a table to the current query using the provided join criteria.
public crossJoin(string $table, string $on, ?string $alias): self
Parameter | Type | Description |
---|
$table | string | |
$on | string | The join criteria. This is mostly just a standard query selection criteria. |
$alias | string | an alias to use for the joined table |
Prepares a SELECT statement with the specified column names and criteria names.
public prepareSelect(array $columns, array $criteriaNames): Statement
Parameter | Type | Description |
---|
$columns | array | the names of the columns to be selected |
$criteriaNames | array | the names of the columns to be used as criteria for the selection |
public insert(mixed $values, string $returning, string $conflictTarget, bool $conflictUpdate, ?Table $table): mixed
Parameter | Type | Description |
---|
$values | mixed | |
$returning | string | |
$conflictTarget | string | |
$conflictUpdate | bool | |
$table | Table | |
Prepares an SQL INSERT statement with the given column names.
public prepareInsert(array $columnNames): Statement
This method takes an array of column names and creates an associative array where each column name is a key and the value is set to null. It then uses the query builder to generate an INSERT query with these values and prepares the query using the adapter.
Parameter | Type | Description |
---|
$columnNames | array | an array of column names to be included in the INSERT statement |
public insertModel(Model $model, string $conflictTarget, mixed $conflictUpdate): Model
Parameter | Type | Description |
---|
$model | Model | |
$conflictTarget | string | |
$conflictUpdate | mixed | |
Updates records in the database table.
public update(mixed $values, string $where, mixed $returning): mixed
Parameter | Type | Description |
---|
$values | mixed | The values to update in the table. This can be an associative array of column-value pairs. |
$where | string | The conditions to identify the records to update. This can be an associative array of column-value pairs or a string condition. |
$returning | mixed | Optional. Specifies the columns to return after the update. This can be a string or an array of column names. |
Prepares an update statement with the specified column names and criteria names.
public prepareUpdate(array $columnNames, array $criteriaNames): Statement
Parameter | Type | Description |
---|
$columnNames | array | the names of the columns to be updated |
$criteriaNames | array | the names of the columns to be used as criteria for the update |
Updates the given model in the database based on the specified criteria.
public updateModel(Model $model, string $where): Model
Parameter | Type | Description |
---|
$model | Model | the model instance to be updated |
$where | string | The criteria for selecting the record(s) to be updated. Can be an array of keys or a single key. |
public delete(string $where): int
Parameter | Type | Description |
---|
$where | string | |
Prepares a DELETE statement with the specified criteria names.
public prepareDelete(array $criteriaNames): Statement
Parameter | Type | Description |
---|
$criteriaNames | array | the names of the columns to be used as criteria for the deletion |
public truncate(bool $cascade): bool
Parameter | Type | Description |
---|
$cascade | bool | |
public find(mixed $where, mixed $columns): Result
Parameter | Type | Description |
---|
$where | mixed | |
$columns | mixed | |
public where(mixed $where): self
Parameter | Type | Description |
---|
$where | mixed | |
public findOne(string $where, mixed $columns, false $): void
Parameter | Type | Description |
---|
$where | string | |
$columns | mixed | |
$ | false | |
Finds a single model instance based on the specified conditions.
public findOneModel(string $model, string $where): Model
Parameter | Type | Description |
---|
$model | string | the fully qualified class name of the model to instantiate |
$where | string | the conditions to use for finding the record |
public findOneRow(string $where, string $columns): Row
Parameter | Type | Description |
---|
$where | string | |
$columns | string | |
public fetchAll(?string $keyColumn, false $): void
Parameter | Type | Description |
---|
$keyColumn | string | |
$ | false | |
public fetchAllColumn(string $columnName, mixed $fetchArgument, bool $clobberDupNamedCols, false $): void
Parameter | Type | Description |
---|
$columnName | string | |
$fetchArgument | mixed | |
$clobberDupNamedCols | bool | |
$ | false | |
public describe(false $): void
Parameter | Type | Description |
---|
$ | false | |
public create(mixed $columns): bool
Parameter | Type | Description |
---|
$columns | mixed | |
public getPrimaryKey(false $): void
Parameter | Type | Description |
---|
$ | false | |
Generated by Hazaar API Doc Generator