ddeboer / data-import

Import data from and export data to a range of different file formats and media
MIT License
567 stars 123 forks source link

Make member variables of MappingStep.php protected #279

Closed Nexotap closed 8 years ago

Nexotap commented 8 years ago

Hi. Is there anything against making the member variables from Step/MappingStep.php protected?

I need some customization in the mapping step. That for I've created a new class, extending the MappingStep.php. While overriding the process function, I encountered the problem of 2 private member variables.

Is it maybe a complete wrong approach to subclass and override this function? Or is it better to not subclass and write a complete class of its own?

edit: I've seen there's a FilterStep.php. I think if I would know how this step works. I could use this, instead of subclassing MappingStep.php.

Maybe someone can give me an example of how the Filterstep.php is used?

Baachi commented 8 years ago

We use private as default for maintenance reasons. Here an example for the FilterStep:

$step = new FilterStep();
$step->add(new Filter\OffsetFilter(5));

$workflow = new StepAggregator($reader);
$workflow->addStep($step);

$workflow->process();