extends |
Persistence |
|---|
Implements persistence driver that can save data into array and load from array. This basic driver only offers the load/save support based around ID, you can't use conditions, order or limit.
| Methods | ||
|---|---|---|
public
|
__construct(array<int|string, mixed> $data = [])
|
# |
private
|
seedData(Model $model): void
|
# |
private
|
seedDataAndGetTable(Model $model): Table
|
# |
public
|
getRawDataByTable(Model $model, string $table): array<mixed, array<string, mixed>>
|
# |
private
|
assertNoIdMismatch(Model $model, int|string|null $idFromRow, int|string $id): void
|
# |
private
|
saveRow(Model $model, array<string, mixed> $rowData, mixed $id): void
|
# |
public
|
add(Model $model, array $defaults = []): void
|
# |
private
|
getPersistenceNameToNameMap(Model $model): array<string, string>
|
# |
private
|
filterRowDataOnlyModelFields(Model $model, array<string, mixed> $rowDataRaw): array<string, mixed>
|
# |
private
|
remapLoadRow(Model $model, array<string, mixed> $row): array<string, mixed>
|
# |
public
|
tryLoad(Model $model, $id): ?array
|
# |
protected
|
insertRaw(Model $model, array $dataRaw)
|
# |
protected
|
updateRaw(Model $model, $idRaw, array $dataRaw): void
|
# |
protected
|
deleteRaw(Model $model, $idRaw): void
|
# |
public
|
generateNewId(Model $model): string
|
# |
public
|
lastInsertId(Model $model = null): mixed
|
# |
public
|
prepareIterator(Model $model): Traversable<array<string, mixed>>
|
# |
public
|
export(Model $model, array<int, string>|null $fields = null, bool $typecast = true): array<int, array<string, mixed>>
|
# |
public
|
initAction(Model $model, array<int, string>|null $fields = null): Action
|
# |
protected
|
setLimitOrder(Model $model, Action $action): void
|
# |
protected
|
applyScope(Model $model, Action $action): void
|
# |
public
|
action(Model $model, string $type, array<mixed> $args = []): Action
|
# |
| Methods used from Atk4\Core\ContainerTrait |
|---|
_uniqueElementName(), _addContainer(), removeElement(), _shorten(), getElement(), hasElement() |
| Methods used from Atk4\Core\DiContainerTrait |
|---|
setDefaults(), setMissingProperty(), assertInstanceOf(), _fromSeedPrecheck(), fromSeed(), fromSeedUnsafe() |
| Methods used from Atk4\Core\DynamicMethodTrait |
|---|
__call(), buildMethodHookName(), addMethod(), hasMethod(), removeMethod() |
| Constants inherited from Atk4\Data\Persistence |
|---|
|
| Properties | |||
|---|---|---|---|
private
|
array<string, array<int|string, mixed>>
|
$seedData
|
# |
private
|
array<string, Table>
|
$data
|
# |
protected
|
array<string, int>
|
$maxSeenIdByTable = []
|
# |
protected
|
array<string, int|string>
|
$lastInsertIdByTable = []
|
# |
protected
|
string
|
$lastInsertIdTable
|
# |
| Properties inherited from Atk4\Data\Persistence |
|---|
$typecastSaveSkipNormalize |
| Properties used from Atk4\Core\ContainerTrait |
|---|
$elements, $_elementNameCounts |
| Properties used from Atk4\Core\HookTrait |
|---|
$hooks, $_hookIndexCounter, $_hookOrigThis |
| Properties used from Atk4\Core\NameTrait |
|---|
$name |