Skip to content

Commit

Permalink
[+FEAT] Row skip functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
paales committed Oct 3, 2013
1 parent 49c324f commit c308a49
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/code/local/Ho/Import/Model/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ public function mapLines($lines) {
$sourceRows[$line] = $sourceAdapter->current();
$transport->setData('items', array($sourceRows[$line]));
$this->_runEvent('source_row_fieldmap_before', $transport);
if ($transport->getData('skip')) {
$this->_getLog()->log($this->_getLog()->__('This line (%s) would be skipped', $line));
}

$i = 0;
foreach ($transport->getData('items') as $preparedItem) {
Expand Down Expand Up @@ -228,6 +231,11 @@ protected function _createImportCsv() {
$transport = $this->_getTransport();
$transport->setData('items', array($sourceAdapter->current()));
$this->_runEvent('source_row_fieldmap_before', $transport);
if ($transport->getData('skip')) {
$rowCount++;
$sourceAdapter->next();
continue;
}

foreach ($transport->getData('items') as $preparedItem) {
$result = $this->_fieldMapItem($preparedItem);
Expand Down

0 comments on commit c308a49

Please sign in to comment.