ProductImport
extends ProductImport
in package
History and state of one import job: file, format, job settings, state, counts, times and the uploader. Holds bookkeeping only; parsing, validation and execution live elsewhere.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_product_imports'
- #[TableAlias]
- 'productImport'
Table of Contents
Properties
- $createdCount : int
- $errorCount : int
- $fileName : string
- $filePath : string
- $finishedTime : DateTime|null
- $format : ProductImportFormat
- $id : int|null
- $insertTime : DateTime
- $logPath : string|null
- $processedItems : int
- $settings : array<string, mixed>|null
- $skippedCount : int
- $startedTime : DateTime|null
- $state : ProductImportState
- $totalItems : int
- $updatedCount : int
- $user : TUser|null
- $warningCount : int
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getCreatedCount() : int
- getErrorCount() : int
- getFileName() : string
- getFilePath() : string
- getFinishedTime() : DateTime|null
- getFormat() : ProductImportFormat
- getId() : int|null
- getInsertTime() : DateTime
- getLogPath() : string|null
- getProcessedItems() : int
- getSettings() : array<string, mixed>|null
- getSkippedCount() : int
- getStartedTime() : DateTime|null
- getState() : ProductImportState
- getTotalItems() : int
- getUpdatedCount() : int
- getUser() : TUser|null
- getUserId() : int|null
- getWarningCount() : int
- isPersisted() : bool
- setCreatedCount() : $this
- setErrorCount() : $this
- setFileName() : $this
- setFilePath() : $this
- setFinishedTime() : $this
- setFormat() : $this
- setId() : $this
- setInsertTime() : $this
- setLogPath() : $this
- setProcessedItems() : $this
- setSettings() : $this
- setSkippedCount() : $this
- setStartedTime() : $this
- setState() : $this
- setTotalItems() : $this
- setUpdatedCount() : $this
- setUser() : $this
- setWarningCount() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$createdCount
protected
int
$createdCount
= 0
Attributes
- #[Column]
- $name: 'created_count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$errorCount
protected
int
$errorCount
= 0
Attributes
- #[Column]
- $name: 'error_count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$fileName
protected
string
$fileName
= ''
Attributes
- #[Column]
- $name: 'file_name'
- $type: 'string'
- $length: 255
$filePath
protected
string
$filePath
= ''
Attributes
- #[Column]
- $name: 'file_path'
- $type: 'string'
- $length: 500
$finishedTime
protected
DateTime|null
$finishedTime
= null
Attributes
- #[Column]
- $name: 'finished_time'
- $type: 'datetime'
- $nullable: true
$format
protected
ProductImportFormat
$format
= ProductImportFormat::Xml
Attributes
- #[Column]
- $name: 'format'
- $type: 'string'
- $length: 10
- $enumType: ProductImportFormat::class
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'product_import_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertTime
protected
DateTime
$insertTime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_time'
- $type: 'datetime'
$logPath
protected
string|null
$logPath
= null
Attributes
- #[Column]
- $name: 'log_path'
- $type: 'string'
- $length: 500
- $nullable: true
$processedItems
protected
int
$processedItems
= 0
Attributes
- #[Column]
- $name: 'processed_items'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$settings
protected
array<string, mixed>|null
$settings
= null
job settings (mode, matchBy, defaultLang, collectionMode, auto-create options, stopOnError)
Attributes
- #[Column]
- $name: 'settings'
- $type: 'json'
- $nullable: true
$skippedCount
protected
int
$skippedCount
= 0
Attributes
- #[Column]
- $name: 'skipped_count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$startedTime
protected
DateTime|null
$startedTime
= null
Attributes
- #[Column]
- $name: 'started_time'
- $type: 'datetime'
- $nullable: true
$state
protected
ProductImportState
$state
= ProductImportState::Uploaded
Attributes
- #[Column]
- $name: 'state'
- $type: 'string'
- $length: 20
- $enumType: ProductImportState::class
$totalItems
protected
int
$totalItems
= 0
Attributes
- #[Column]
- $name: 'total_items'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$updatedCount
protected
int
$updatedCount
= 0
Attributes
- #[Column]
- $name: 'updated_count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
$user
protected
TUser|null
$user
= null
user who uploaded it (admin); cross-module FK, mapped in the Api/Admin leaf
Attributes
- #[JoinColumn]
- $name: 'cms_system_users_user_id'
- $referencedColumnName: 'user_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\System\Models\Entities\User::class
- $fetch: 'LAZY'
$warningCount
protected
int
$warningCount
= 0
Attributes
- #[Column]
- $name: 'warning_count'
- $type: 'integer'
- $options: ['unsigned' => true, 'default' => 0]
Methods
__construct()
public
__construct([int|null $id = null ][, string $fileName = '' ][, string $filePath = '' ][, ProductImportFormat $format = ProductImportFormat::Xml ][, array<string|int, mixed>|null $settings = null ][, ProductImportState $state = ProductImportState::Uploaded ][, int $totalItems = 0 ][, int $processedItems = 0 ][, int $createdCount = 0 ][, int $updatedCount = 0 ][, int $skippedCount = 0 ][, int $errorCount = 0 ][, int $warningCount = 0 ][, string|null $logPath = null ][, mixed $user = null ][, DateTime $insertTime = new DateTime() ][, DateTime|null $startedTime = null ][, DateTime|null $finishedTime = null ]) : mixed
Parameters
- $id : int|null = null
- $fileName : string = ''
- $filePath : string = ''
- $format : ProductImportFormat = ProductImportFormat::Xml
- $settings : array<string|int, mixed>|null = null
- $state : ProductImportState = ProductImportState::Uploaded
- $totalItems : int = 0
- $processedItems : int = 0
- $createdCount : int = 0
- $updatedCount : int = 0
- $skippedCount : int = 0
- $errorCount : int = 0
- $warningCount : int = 0
- $logPath : string|null = null
- $user : mixed = null
- $insertTime : DateTime = new DateTime()
- $startedTime : DateTime|null = null
- $finishedTime : DateTime|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getCreatedCount()
public
getCreatedCount() : int
Return values
intgetErrorCount()
public
getErrorCount() : int
Return values
intgetFileName()
public
getFileName() : string
Return values
stringgetFilePath()
public
getFilePath() : string
Return values
stringgetFinishedTime()
public
getFinishedTime() : DateTime|null
Return values
DateTime|nullgetFormat()
public
getFormat() : ProductImportFormat
Return values
ProductImportFormatgetId()
public
getId() : int|null
Return values
int|nullgetInsertTime()
public
getInsertTime() : DateTime
Return values
DateTimegetLogPath()
public
getLogPath() : string|null
Return values
string|nullgetProcessedItems()
public
getProcessedItems() : int
Return values
intgetSettings()
public
getSettings() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetSkippedCount()
public
getSkippedCount() : int
Return values
intgetStartedTime()
public
getStartedTime() : DateTime|null
Return values
DateTime|nullgetState()
public
getState() : ProductImportState
Return values
ProductImportStategetTotalItems()
public
getTotalItems() : int
Return values
intgetUpdatedCount()
public
getUpdatedCount() : int
Return values
intgetUser()
public
getUser() : TUser|null
Return values
TUser|nullgetUserId()
public
getUserId() : int|null
Return values
int|nullgetWarningCount()
public
getWarningCount() : int
Return values
intisPersisted()
public
isPersisted() : bool
Return values
boolsetCreatedCount()
public
setCreatedCount(int $createdCount) : $this
Parameters
- $createdCount : int
Return values
$thissetErrorCount()
public
setErrorCount(int $errorCount) : $this
Parameters
- $errorCount : int
Return values
$thissetFileName()
public
setFileName(string $fileName) : $this
Parameters
- $fileName : string
Return values
$thissetFilePath()
public
setFilePath(string $filePath) : $this
Parameters
- $filePath : string
Return values
$thissetFinishedTime()
public
setFinishedTime(DateTime|null $finishedTime) : $this
Parameters
- $finishedTime : DateTime|null
Return values
$thissetFormat()
public
setFormat(ProductImportFormat $format) : $this
Parameters
- $format : ProductImportFormat
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertTime()
public
setInsertTime(DateTime $insertTime) : $this
Parameters
- $insertTime : DateTime
Return values
$thissetLogPath()
public
setLogPath(string|null $logPath) : $this
Parameters
- $logPath : string|null
Return values
$thissetProcessedItems()
public
setProcessedItems(int $processedItems) : $this
Parameters
- $processedItems : int
Return values
$thissetSettings()
public
setSettings(array<string, mixed>|null $settings) : $this
Parameters
- $settings : array<string, mixed>|null
Return values
$thissetSkippedCount()
public
setSkippedCount(int $skippedCount) : $this
Parameters
- $skippedCount : int
Return values
$thissetStartedTime()
public
setStartedTime(DateTime|null $startedTime) : $this
Parameters
- $startedTime : DateTime|null
Return values
$thissetState()
public
setState(ProductImportState $state) : $this
Parameters
- $state : ProductImportState
Return values
$thissetTotalItems()
public
setTotalItems(int $totalItems) : $this
Parameters
- $totalItems : int
Return values
$thissetUpdatedCount()
public
setUpdatedCount(int $updatedCount) : $this
Parameters
- $updatedCount : int
Return values
$thissetUser()
public
setUser(TUser|null $user) : $this
Parameters
- $user : TUser|null
Return values
$thissetWarningCount()
public
setWarningCount(int $warningCount) : $this
Parameters
- $warningCount : int
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>