ImportMafProductsCommand
extends ContainerAwareCommand
Table of Contents
Constants
-
DEFAULT_DIRECTORY
= 'meduse/connectors/logidav/maf-products'
-
EXPECTED_HEADERS
= ['sku', 'name', 'description', 'price']
-
TARGET_STORE_ID
= 3
Properties
-
$defaultName
: mixed
Methods
-
configure()
: mixed
-
execute()
: mixed
-
getEntityManager()
: EntityManagerInterface
-
guessDelimiter()
: string
-
looksLikeHeader()
: bool
-
normalisePrice()
: float|null
-
normaliseRow()
: array<string, string|null>
-
openRemoteCsvStream()
: resource|false
-
resolveLatestCsv()
: string|null
-
stripBom()
: string
DEFAULT_DIRECTORY
private
mixed
DEFAULT_DIRECTORY
= 'meduse/connectors/logidav/maf-products'
private
mixed
EXPECTED_HEADERS
= ['sku', 'name', 'description', 'price']
TARGET_STORE_ID
private
mixed
TARGET_STORE_ID
= 3
$defaultName
protected
static mixed
$defaultName
= 'mauroferretti:import-maf-products'
protected
configure() : mixed
execute()
protected
execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
-
$input
: InputInterface
-
-
$output
: OutputInterface
-
getEntityManager()
private
getEntityManager() : EntityManagerInterface
Return values
EntityManagerInterface
guessDelimiter()
private
guessDelimiter(string $sample) : string
Parameters
-
$sample
: string
-
private
looksLikeHeader(array<string|int, mixed> $row) : bool
Parameters
-
$row
: array<string|int, mixed>
-
normalisePrice()
private
normalisePrice(string|null $raw) : float|null
Parameters
-
$raw
: string|null
-
normaliseRow()
private
normaliseRow(array<string|int, mixed> $row, array<string|int, mixed>|null $headerMap) : array<string, string|null>
Parameters
-
$row
: array<string|int, mixed>
-
-
$headerMap
: array<string|int, mixed>|null
-
Return values
array<string, string|null>
openRemoteCsvStream()
private
openRemoteCsvStream(Ftp $ftp, string $remoteFile, OutputInterface $output) : resource|false
Parameters
-
$ftp
: Ftp
-
-
$remoteFile
: string
-
-
$output
: OutputInterface
-
Return values
resource|false
resolveLatestCsv()
private
resolveLatestCsv(Ftp $ftp, string $directory, OutputInterface $output) : string|null
Parameters
-
$ftp
: Ftp
-
-
$directory
: string
-
-
$output
: OutputInterface
-
Return values
string|null
stripBom()
private
stripBom(string $value) : string
Parameters
-
$value
: string
-