Item
Item
Represents a synchronization item for database import/export operations.
class Item extends \Hazaar\Model\StructExtends: Hazaar\Model\Struct
Encapsulates row data, table information, and execution logic for synchronizing database tables.
Properties
message
The message to log during execution, if any.
public string $messageType: string
exec
The SQL statement to execute, if any.
public string $execType: string
table
The name of the table to synchronize.
public string $tableType: string
truncate
Whether to truncate the table before import.
public bool $truncateType: bool
insertOnly
Whether to only insert new rows (skip updates).
public bool $insertOnlyType: bool
rows
public array $rowsType: array
keys
public array $keysType: array
vars
public array $varsType: array
refs
public array $refsType: array
primaryKey
private array $primaryKeyType: array
baseDir
public string $baseDirType: string
Methods
run
Executes the synchronization item, processing rows and applying changes to the database.
public run(Adapter $dbi, Stats $stats, ?string $baseDir): ?StatsReturns: Hazaar\DBI\Manager\Sync\Stats
Handles logging, variable and macro application, SQL execution, table truncation, and row processing.
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
$stats | Hazaar\DBI\Manager\Sync\Stats | the statistics object to update during processing |
$baseDir | string | directory that ::file(...) references resolve relative to |
getRowItem
private getRowItem(Adapter $dbi, array $data): RowStatusReturns: Hazaar\DBI\Manager\Sync\Enums\RowStatus
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | |
$data | array |
fixTypes
private fixTypes(array $row, array $existingRow): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | array | |
$existingRow | array |
applyVars
private applyVars(array $row): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | array |
applyVarsToField
private applyVarsToField(string $field): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$field | string |
applyMacros
private applyMacros(Adapter $dbi, array $row): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | |
$row | array |
fixJsonFields
private fixJsonFields(array $row): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$row | array |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000