ePages 7.28.0 - DE_EPAGES/PriceMinister/API/CSV/PriceMinisterExportDriver.pm

Package DE_EPAGES::PriceMinister::API::CSV::PriceMinisterExportDriver

This module implements a csv driver to export object PriceMinister products

Example
use DE_EPAGES::PriceMinister::API::CSV::PriceMinisterExportDriver;

my $Driver = DE_EPAGES::PriceMinister::API::CSV::PriceMinisterExportDriver->new(
    Handler => $Handler
);
$Driver->exportCSV;

Functions

exportCSV
exportLine
getExportValues
isProductValid
writeHeader

exportCSV

exports data (2 dim. array) into a file. sets default file format parameters : sep_char = ";" , always_quote = 1 , encoding = utf8

Syntax
$Exporter->exportCSV($FileName, $hFormat, $aColumns, $ViewObject, $aObjects );
Input
$FileName (string)
export file
$ViewObject (object)
object to view monitor should be the shop
$hFileFormat
$aColumnNames
$Offer
$RemoveFlag
if 1 then products quantity will be exported with stocklevel 0
Return
status of succeeded export

exportLine

Writes one line to the CSV file. Gets the values of the current export item from the function getValues. Increments the monitor counter if defined $self->monitor.

Syntax
$self->exportLine();
Return
$self->writeLine($self->getExportValues($Object));

getExportValues

helper method of exportLine to convert column names to methods names of this exporter and calls the method to get the values of the exported object. The order of return values depends on order of column names.

Syntax
$self->getExportValues($Product);
Input
$Product (object)
product
Return
$aValues (ref.array.string)
list of values

isProductValid

Throws error if not valid, (not visible).

Syntax
$self->isProductValid;
Input
$Product (object)
product
Return
true if no error occurs

writeHeader

Writes the header line using the attribute names of the columns.

Syntax
$self->writeHeader();