Data
Data
Represents a data synchronization set for database import/export operations.
class Data extends \Hazaar\Model\StructExtends: Hazaar\Model\Struct
Encapsulates applied versions and sync items, and provides methods for loading, hashing, and running sync operations.
Properties
appliedVersions
public array $appliedVersionsType: array
items
public array $itemsType: array
baseDir
public string $baseDirType: string
Methods
construct
Initializes the data set from the provided data.
public construct(mixed $data): voidReturns: void
Wraps the input data in an 'items' array for internal consistency.
Parameters
| Parameter | Type | Description |
|---|---|---|
$data | mixed | The data to initialize from. Modified by reference. |
load
Loads a data set from a JSON file.
public load(string $sourceFile): selfReturns: self
Parameters
| Parameter | Type | Description |
|---|---|---|
$sourceFile | string | the path to the JSON file to load |
setBaseDir
Sets the directory that ::file(...) references in this data set resolve relative to.
public setBaseDir(string $baseDir): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$baseDir | string |
getBaseDir
Returns the directory that ::file(...) references in this data set resolve relative to.
public getBaseDir(): ?stringReturns: string
getHash
Returns a hash of the items for change detection or caching.
public getHash(): stringReturns: string
run
Executes all sync items in the data set, logging progress and statistics.
public run(Adapter $dbi): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$dbi | Hazaar\DBI\Adapter | the database adapter instance |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000