Add CSV Formatter in services and fix bug on diplaying export and imports

modifié:         core/lib/Thelia/Config/Resources/config.xml
	modifié:         core/lib/Thelia/Controller/Admin/ExportController.php
	modifié:         core/lib/Thelia/Controller/Admin/ImportController.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/Formatter/CSVFormatter.php
	modifié:         core/lib/Thelia/Core/FileFormat/Formatting/FormatterData.php
This commit is contained in:
Benjamin Perche
2014-07-21 11:37:20 +02:00
parent 27a32e64e6
commit 4e29830bde
5 changed files with 13 additions and 4 deletions

View File

@@ -78,6 +78,7 @@ class CSVFormatter extends AbstractFormatter
public function encode(FormatterData $data)
{
$string = "";
$firstRow = $data->getRow();
$delimiterLength = strlen($this->delimiter);
$lineReturnLength = strlen($this->lineReturn);

View File

@@ -184,7 +184,7 @@ class FormatterData
* @return array|bool
* @throws \OutOfBoundsException
*/
public function getRow($index = 0)
public function getRow($index = 0, $reverseAliases = false)
{
if (empty($this->data)) {
return false;
@@ -199,7 +199,11 @@ class FormatterData
);
}
$row = $this->reverseAliases($this->data[$index], $this->aliases);
$row = $this->data[$index];
if ($reverseAliases === true) {
$row = $this->reverseAliases($row, $this->aliases);
}
return $row;
}