RebuildSaleProductShipmentsCommand
extends ContainerAwareCommand
uses
LockableTrait
Table of Contents
Methods
-
configure()
: mixed
-
execute()
: mixed
-
countSaleProductsToProcess()
: int
-
decodeToArray()
: array<int, string>
-
encodeJsonOrNull()
: string|null
-
fetchColumnValues()
: array<int, mixed>
-
fetchExistingShipments()
: array<int, array<string|int, int>>
-
fetchSingleValue()
: mixed
-
formatDateForSql()
: string|null
-
formatDateTimeForSql()
: string|null
-
normalizeCarrierValue()
: string
-
normalizeIds()
: array<string|int, int>
-
normalizeNullableInt()
: int|null
-
normalizeNullableString()
: string|null
-
removeExistingShipments()
: void
-
resolveShipmentCreatedAt()
: DateTimeImmutable
-
toBoolInt()
: int
-
toDateTimeImmutable()
: DateTimeImmutable|null
-
yieldSaleProductRows()
: Generator<int, array<string, mixed>>
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
-
$input
: InputInterface
-
-
$output
: OutputInterface
-
countSaleProductsToProcess()
private
countSaleProductsToProcess(Connection $connection, array<string|int, int> $saleIds, array<string|int, int> $saleProductIds, bool $force, DateTimeInterface $createdAfter) : int
Parameters
-
$connection
: Connection
-
-
$saleIds
: array<string|int, int>
-
-
$saleProductIds
: array<string|int, int>
-
-
$force
: bool
-
-
$createdAfter
: DateTimeInterface
-
decodeToArray()
private
decodeToArray(mixed $value[, bool $splitByComma = false ]) : array<int, string>
Parameters
-
$value
: mixed
-
-
$splitByComma
: bool
= false
-
Return values
array<int, string>
encodeJsonOrNull()
private
encodeJsonOrNull(mixed $values) : string|null
Parameters
-
$values
: mixed
-
Return values
string|null
fetchColumnValues()
private
fetchColumnValues(object $statement) : array<int, mixed>
Parameters
-
$statement
: object
-
Return values
array<int, mixed>
fetchExistingShipments()
private
fetchExistingShipments(Connection $connection, array<string|int, int> $saleProductIds) : array<int, array<string|int, int>>
Parameters
-
$connection
: Connection
-
-
$saleProductIds
: array<string|int, int>
-
Return values
array<int, array<string|int, int>>
fetchSingleValue()
private
fetchSingleValue(object $statement) : mixed
Parameters
-
$statement
: object
-
private
formatDateForSql(DateTimeInterface|null $value) : string|null
Parameters
-
$value
: DateTimeInterface|null
-
Return values
string|null
private
formatDateTimeForSql(DateTimeInterface|null $value) : string|null
Parameters
-
$value
: DateTimeInterface|null
-
Return values
string|null
normalizeCarrierValue()
private
normalizeCarrierValue(mixed $carrier, mixed $fallback) : string
Parameters
-
$carrier
: mixed
-
-
$fallback
: mixed
-
normalizeIds()
private
normalizeIds(array<string|int, string> $values) : array<string|int, int>
Parameters
-
$values
: array<string|int, string>
-
Return values
array<string|int, int>
normalizeNullableInt()
private
normalizeNullableInt(mixed $value) : int|null
Parameters
-
$value
: mixed
-
normalizeNullableString()
private
normalizeNullableString(mixed $value) : string|null
Parameters
-
$value
: mixed
-
Return values
string|null
removeExistingShipments()
private
removeExistingShipments(Connection $connection, array<int, array<string|int, int>> $shipmentsMap) : void
Parameters
-
$connection
: Connection
-
-
$shipmentsMap
: array<int, array<string|int, int>>
-
resolveShipmentCreatedAt()
private
resolveShipmentCreatedAt(array<string, mixed> $row, DateTimeImmutable $saleCreatedAt) : DateTimeImmutable
Parameters
-
$row
: array<string, mixed>
-
-
$saleCreatedAt
: DateTimeImmutable
-
Return values
DateTimeImmutable
toBoolInt()
private
toBoolInt(mixed $value) : int
Parameters
-
$value
: mixed
-
toDateTimeImmutable()
private
toDateTimeImmutable(mixed $value) : DateTimeImmutable|null
Parameters
-
$value
: mixed
-
Return values
DateTimeImmutable|null
yieldSaleProductRows()
private
yieldSaleProductRows(Connection $connection, array<string|int, mixed> $saleIds, array<string|int, mixed> $saleProductIds, bool $force, int $batchSize, DateTimeInterface $createdAfter) : Generator<int, array<string, mixed>>
Parameters
-
$connection
: Connection
-
-
$saleIds
: array<string|int, mixed>
-
-
$saleProductIds
: array<string|int, mixed>
-
-
$force
: bool
-
-
$batchSize
: int
-
-
$createdAfter
: DateTimeInterface
-
Return values
Generator<int, array<string, mixed>>