Exemplo n.º 1
0
 /**
  * @throws FireflyException
  */
 public function run()
 {
     set_time_limit(0);
     $this->journals = new Collection();
     $this->map = $this->data->getMap();
     $this->roles = $this->data->getRoles();
     $this->mapped = $this->data->getMapped();
     $this->specifix = $this->data->getSpecifix();
     foreach ($this->data->getReader() as $index => $row) {
         if ($this->parseRow($index)) {
             Log::debug('--- Importing row ' . $index);
             $this->rows++;
             $result = $this->importRow($row);
             if (!$result instanceof TransactionJournal) {
                 Log::error('Caught error at row #' . $index . ': ' . $result);
                 $this->errors[$index] = $result;
             } else {
                 $this->imported++;
                 $this->journals->push($result);
             }
             Log::debug('---');
         }
     }
     // once all journals have been imported (or not)
     // fire the rules.
     $this->fireRules();
 }