| Methods |
public
|
__construct(
Connection|string|array<string, string>|Connection|Connection $connection,
string $user = null,
string $password = null,
array<string, mixed> $defaults = [],
)
|
#
|
public
|
getConnection(): Connection
|
#
|
public
|
disconnect(): void
Disconnect from database explicitly.
Disconnect from database explicitly.
Overrides
|
#
|
public
|
atomic(Closure $fx)
Atomic executes operations within one begin/end transaction. Not all
persistencies will support atomic operations, so…
Atomic executes operations within one begin/end transaction. Not all
persistencies will support atomic operations, so by default we just
don't do anything.
Overrides
|
#
|
public
|
getDatabasePlatform(): AbstractPlatform
|
#
|
public
|
add(Model $model, array $defaults = []): void
Associate model with the data driver.
Associate model with the data driver.
Overrides
|
#
|
protected
|
initPersistence(Model $model): void
Extend this method to enhance model to work with your persistence. Here
you can define additional methods or store…
Extend this method to enhance model to work with your persistence. Here
you can define additional methods or store additional data. This method
is executed before model's init().
Overrides
|
#
|
public
|
expr(Model $model, string $template, array<int|string, mixed> $arguments = []): Expression
Creates new Expression object from expression string.
Creates new Expression object from expression string.
|
#
|
public
|
exprNow(int $precision = null): Expression
Creates new Query object with current time expression.
Creates new Query object with current time expression.
|
#
|
public
|
dsql(): Query
Creates new Query object.
Creates new Query object.
|
#
|
public
|
initQuery(Model $model): Query
Initializes base query for model $m.
Initializes base query for model $m.
|
#
|
public
|
initWithCursors(Model $model, Query $query): void
|
#
|
public
|
initField(Query $query, Field $field): void
Adds Field in Query.
|
#
|
public
|
initQueryFields(Model $model, Query $query, array<int, string>|null $fields = null): void
Adds model fields in Query.
Adds model fields in Query.
|
#
|
protected
|
setLimitOrder(Model $model, Query $query): void
Will set limit defined inside $m onto query $q.
Will set limit defined inside $m onto query $q.
|
#
|
public
|
initQueryConditions(Model $model, Query $query): void
Will apply model scope/conditions onto $query.
Will apply model scope/conditions onto $query.
|
#
|
private
|
fixMssqlOracleMissingFieldsInGroup(Model $model, Query $query): void
|
#
|
private
|
_initQueryConditions(Query $query, AbstractScope $condition = null): void
|
#
|
public
|
action(Model $model, string $type, array<mixed> $args = []): Query
|
#
|
public
|
tryLoad(Model $model, $id): ?array
Tries to load data record, but will not fail if record can't be loaded.
Tries to load data record, but will not fail if record can't be loaded.
Overrides
|
#
|
public
|
export(Model $model, array<int, string>|null $fields = null, bool $typecast = true): array<int, array<string, mixed>>
Export all DataSet.
|
#
|
public
|
prepareIterator(Model $model): Traversable<array<string, mixed>>
|
#
|
private
|
assertExactlyOneRecordUpdated(Model $model, mixed $idRaw, int $affectedRows, string $operation): void
|
#
|
protected
|
insertRaw(Model $model, array<scalar|Expressionable|null> $dataRaw)
|
#
|
protected
|
updateRaw(Model $model, $idRaw, array<scalar|Expressionable|null> $dataRaw): void
|
#
|
protected
|
deleteRaw(Model $model, $idRaw): void
|
#
|
public
|
typecastSaveField(Field $field, $value)
Prepare value of a specific field by converting it to
persistence-friendly format.
Prepare value of a specific field by converting it to
persistence-friendly format.
Overrides
|
#
|
public
|
typecastLoadField(Field $field, $value)
Cast specific field value from the way how it's stored inside
persistence to a PHP format.
Cast specific field value from the way how it's stored inside
persistence to a PHP format.
Overrides
|
#
|
protected
|
_typecastSaveField(Field $field, $value)
This is the actual field typecasting, which you can override in your
persistence to implement necessary typecasting.
This is the actual field typecasting, which you can override in your
persistence to implement necessary typecasting.
Overrides
|
#
|
public
|
getFieldSqlExpression(Field $field, Expression $expression): Expression
|
#
|
public
|
lastInsertId(Model $model): string
|
#
|