ImportDto
in package
Normalized, format-independent shape of the whole file. The XML parser fills it today and the CSV/JSON parsers fill it the same way, so the validator and executor do not depend on the format.
IMPORTANT: $products is an iterator, not an array (XML up to 100 MB). The parser yields products in a
single pass and keeps one card in memory, so it can be iterated only once; a second pass
(accessories) must collect its own compact data on the way.
$fileSettings is a proposal from the file, not a decision; the source of truth is the job settings.
IMPORTANT: $rootIssues is complete only after $products has been fully iterated (see ImportIssueBag).
$bundleBag has the same condition: for XML it is complete only after $products has been fully iterated
(the parser fills it in the epilogue, see ImportBundleBag); for CSV (no bundles, the bag stays
empty) and JSON (whole file in memory) it is ready immediately. Call getBundles() only after
exhausting getProducts().
Table of Contents
Properties
- $bundleBag : ImportBundleBag
- $fileSettings : ImportSettingsDto|null
- $rootIssues : ImportIssueBag
- $version : string
- $products : iterable<string|int, mixed>
Methods
- __construct() : mixed
- getBundles() : array<int, ImportBundleDto>
- getProducts() : iterable<int, ImportProductDto>
Properties
$bundleBag read-only
public
ImportBundleBag
$bundleBag
= new ImportBundleBag()
$fileSettings read-only
public
ImportSettingsDto|null
$fileSettings
$rootIssues read-only
public
ImportIssueBag
$rootIssues
$version read-only
public
string
$version
$products read-only
private
iterable<string|int, mixed>
$products
Methods
__construct()
public
__construct(string $version, ImportSettingsDto|null $fileSettings, ImportIssueBag $rootIssues, iterable<int, ImportProductDto> $products[, ImportBundleBag $bundleBag = new ImportBundleBag() ]) : mixed
Parameters
- $version : string
- $fileSettings : ImportSettingsDto|null
- $rootIssues : ImportIssueBag
- $products : iterable<int, ImportProductDto>
- $bundleBag : ImportBundleBag = new ImportBundleBag()
getBundles()
public
getBundles() : array<int, ImportBundleDto>
Return values
array<int, ImportBundleDto>getProducts()
public
getProducts() : iterable<int, ImportProductDto>