CoolCMS API

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
extends
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]
#[ExternalReadonly]

$errorCount

protected int $errorCount = 0
Attributes
#[Column]
$name: 'error_count'
$type: 'integer'
$options: ['unsigned' => true, 'default' => 0]
#[ExternalReadonly]

$finishedTime

protected DateTime|null $finishedTime = null
Attributes
#[Column]
$name: 'finished_time'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

$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'
#[ExternalReadonly]

$logPath

protected string|null $logPath = null
Attributes
#[Column]
$name: 'log_path'
$type: 'string'
$length: 500
$nullable: true
#[ExternalReadonly]

$processedItems

protected int $processedItems = 0
Attributes
#[Column]
$name: 'processed_items'
$type: 'integer'
$options: ['unsigned' => true, 'default' => 0]
#[ExternalReadonly]

$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]
#[ExternalReadonly]

$startedTime

protected DateTime|null $startedTime = null
Attributes
#[Column]
$name: 'started_time'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

$totalItems

protected int $totalItems = 0
Attributes
#[Column]
$name: 'total_items'
$type: 'integer'
$options: ['unsigned' => true, 'default' => 0]
#[ExternalReadonly]

$updatedCount

protected int $updatedCount = 0
Attributes
#[Column]
$name: 'updated_count'
$type: 'integer'
$options: ['unsigned' => true, 'default' => 0]
#[ExternalReadonly]

$user

protected TUser|null $user = null

user who uploaded it (admin); cross-module FK, mapped in the Api/Admin leaf

Attributes
#[EntityOf]
\App\UI\Admin\System\Models\Entities\User::class
#[JoinColumn]
$name: 'cms_system_users_user_id'
$referencedColumnName: 'user_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\System\Models\Entities\User::class
$fetch: 'LAZY'

$warningCount

protected int $warningCount = 0
Attributes
#[Column]
$name: 'warning_count'
$type: 'integer'
$options: ['unsigned' => true, 'default' => 0]
#[ExternalReadonly]

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
int

getErrorCount()

public getErrorCount() : int
Return values
int

getFileName()

public getFileName() : string
Return values
string

getFilePath()

public getFilePath() : string
Return values
string

getFinishedTime()

public getFinishedTime() : DateTime|null
Return values
DateTime|null

getInsertTime()

public getInsertTime() : DateTime
Return values
DateTime

getLogPath()

public getLogPath() : string|null
Return values
string|null

getProcessedItems()

public getProcessedItems() : int
Return values
int

getSettings()

public getSettings() : array<string, mixed>|null
Return values
array<string, mixed>|null

getSkippedCount()

public getSkippedCount() : int
Return values
int

getStartedTime()

public getStartedTime() : DateTime|null
Return values
DateTime|null

getTotalItems()

public getTotalItems() : int
Return values
int

getUpdatedCount()

public getUpdatedCount() : int
Return values
int

getUser()

public getUser() : TUser|null
Return values
TUser|null

getUserId()

public getUserId() : int|null
Return values
int|null

getWarningCount()

public getWarningCount() : int
Return values
int

setCreatedCount()

public setCreatedCount(int $createdCount) : $this
Parameters
$createdCount : int
Return values
$this

setErrorCount()

public setErrorCount(int $errorCount) : $this
Parameters
$errorCount : int
Return values
$this

setFileName()

public setFileName(string $fileName) : $this
Parameters
$fileName : string
Return values
$this

setFilePath()

public setFilePath(string $filePath) : $this
Parameters
$filePath : string
Return values
$this

setFinishedTime()

public setFinishedTime(DateTime|null $finishedTime) : $this
Parameters
$finishedTime : DateTime|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertTime()

public setInsertTime(DateTime $insertTime) : $this
Parameters
$insertTime : DateTime
Return values
$this

setLogPath()

public setLogPath(string|null $logPath) : $this
Parameters
$logPath : string|null
Return values
$this

setProcessedItems()

public setProcessedItems(int $processedItems) : $this
Parameters
$processedItems : int
Return values
$this

setSettings()

public setSettings(array<string, mixed>|null $settings) : $this
Parameters
$settings : array<string, mixed>|null
Return values
$this

setSkippedCount()

public setSkippedCount(int $skippedCount) : $this
Parameters
$skippedCount : int
Return values
$this

setStartedTime()

public setStartedTime(DateTime|null $startedTime) : $this
Parameters
$startedTime : DateTime|null
Return values
$this

setTotalItems()

public setTotalItems(int $totalItems) : $this
Parameters
$totalItems : int
Return values
$this

setUpdatedCount()

public setUpdatedCount(int $updatedCount) : $this
Parameters
$updatedCount : int
Return values
$this

setUser()

public setUser(TUser|null $user) : $this
Parameters
$user : TUser|null
Return values
$this

setWarningCount()

public setWarningCount(int $warningCount) : $this
Parameters
$warningCount : int
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results