src/Adapter/CsvExportAdapter.php
public function export(array $artefacts, $targetDir, $timestamp, $counter)
    {

        // reset the array with the exported filename
        $this->exportedFilenames = array();

        // iterate over the artefacts and export them
        foreach ($artefacts as $artefactType => $artefacts) {
            // initialize the bunch and the exporter
            $bunch = array();

            // iterate over the artefact types artefacts
            foreach ($artefacts as $entityArtefacts) {
                // prepend the bunch header first
                if (sizeof($bunch) === 0) {
                    $bunch[] = array_keys(reset($entityArtefacts));
                }

                // export the artefacts
                foreach ($entityArtefacts as $entityArtefact) {
                    array_push($bunch, $entityArtefact);
                }
            }

            // prepare the name of the export file
            $filename = sprintf(
                '%s/%s_%s_%s.csv',
                $targetDir,
                $artefactType,
                $timestamp,
                $counter
            );

            // export the artefact (bunch)
            $this->exporter->export($filename, $bunch);

            // add the filename to the array with the exported filenames
            $this->exportedFilenames[] = $filename;
        }
    }
public function export(array $artefacts, $targetDir, $timestamp, $counter)
    {

        // reset the array with the exported filename
        $this->exportedFilenames = array();

        // iterate over the artefacts and export them
        foreach ($artefacts as $artefactType => $artefacts) {
            // initialize the bunch and the exporter
            $bunch = array();

            // iterate over the artefact types artefacts
            foreach ($artefacts as $entityArtefacts) {
                // prepend the bunch header first
                if (sizeof($bunch) === 0) {
                    $bunch[] = array_keys(reset($entityArtefacts));
                }

                // export the artefacts
                foreach ($entityArtefacts as $entityArtefact) {
                    array_push($bunch, $entityArtefact);
                }
            }

            // prepare the name of the export file
            $filename = sprintf(
                '%s/%s_%s_%s.csv',
                $targetDir,
                $artefactType,
                $timestamp,
                $counter
            );

            // export the artefact (bunch)
            $this->exporter->export($filename, $bunch);

            // add the filename to the array with the exported filenames
            $this->exportedFilenames[] = $filename;
        }
    }
Imports the content of the CSV file with the passed filename.

@param array   $artefacts The artefacts to be exported
@param string  $targetDir The target dir to export the artefacts to
@param integer $timestamp The timestamp part of the original import file
@param string  $counter   The counter part of the origin import file

@return void