메소드 |
설명 |
|
__construct ( atk4\dsql\Connection | string $connection, string $user = null, string $password = null, array $args = [] ) |
Constructor. |
|
_typecastLoadField ( Field $f, mixed $value ) : mixed |
This is the actual field typecasting, which you can override in your
persistence to implement necessary typecasting. |
|
_typecastSaveField ( Field $f, mixed $value ) : mixed |
This is the actual field typecasting, which you can override in your
persistence to implement necessary typecasting. |
|
action ( Model $m, string $type, array $args = [] ) : atk4\dsql\Query |
Executing $model->action('update') will call this method. |
|
add ( Model | string $m, array $defaults = [] ) : Model |
Associate model with the data driver. |
|
atomic ( callable $f ) : mixed |
Atomic executes operations within one begin/end transaction, so if
the code inside callback will fail, then all of the transaction
will be also rolled back. |
|
delete ( Model $m, mixed $id ) |
Deletes record from database. |
|
dsql ( ) : atk4\dsql\Query |
Returns Query instance. |
|
export ( Model $m, array | null $fields = null ) : array |
Export all DataSet. |
|
expr ( Model $m, string $expr, array $args = [] ) : atk4\dsql\Expression |
Creates new Expression object from expression. |
|
initField ( atk4\dsql\Query $q, Field $field ) |
Adds Field in Query. |
|
initQuery ( Model $m ) : atk4\dsql\Query |
Initializes base query for model $m. |
|
initQueryConditions ( Model $m, atk4\dsql\Query $q ) : atk4\dsql\Query |
Will apply conditions defined inside $m onto query $q. |
|
initQueryFields ( Model $m, atk4\dsql\Query $q, array | null $fields = null ) |
Adds model fields in Query. |
|
insert ( Model $m, array $data ) : mixed |
Inserts record in database and returns new record ID. |
|
load ( Model $m, mixed $id ) : array |
Loads a record from model and returns a associative array. |
|
loadAny ( Model $m ) : array |
Loads any one record. |
|
prepareIterator ( Model $m ) : PDOStatement |
Prepare iterator. |
|
tryLoad ( Model $m, mixed $id ) : array |
Tries to load data record, but will not fail if record can't be loaded. |
|
tryLoadAny ( Model $m ) : array |
Tries to load any one record. |
|
update ( Model $m, mixed $id, array $data ) |
Updates record in database. |
|