fab2s / YaEtl

Yet Another ETL in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CsvExtractor (FileExtractorAbstract) carrier reference in extract()

zodimo opened this issue · comments

Hi

I am unable to use the CsvExtractor as indicated in the documentation.
// standalone
foreach($csvExtractor->getTraversable() as $record) {
// do something with $record array
}

I get the following error.
Error: Call to a member function getFlowMap() on null

commented

Hello,
This is part of what v2 has fixed, it is pretty stable now (used in production) and I will release it as soon as I find the time to do it.

Until then, you can replace this line :

$this->getCarrier()->getFlowMap()->incrementNode($this->getId(), 'num_extract');

with :

$this->getCarrier() && $this->getCarrier()->getFlowMap()->incrementNode($this->getId(), 'num_extract');

here

$this->getCarrier()->getFlowMap()->incrementNode($this->getId(), 'num_extract');