src/Plugins/SubjectPlugin.php
/**
     * Process the subject with the passed name/identifier.
     *
     * We create a new, fresh and separate subject for EVERY file here, because this would be
     * the starting point to parallelize the import process in a multithreaded/multiprocessed
     * environment.
     *
     * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject The subject configuration
     *
     * @return void
     */
Process the subject with the passed name/identifier.
We create a new, fresh and separate subject for EVERY file here, because this would be
the starting point to parallelize the import process in a multithreaded/multiprocessed
environment.



@return void
Process the subject with the passed name / identifier . We create a new fresh and separate subject for EVERY file here because this would be the starting point to parallelize the import process in a multithreaded / multiprocessed environment . @return void
protected function processSubject(SubjectConfigurationInterface $subject)
    {
        $counter = 0;
        $fileResolver = $this->fileResolverFactory->createFileResolver($subject);
        $files = $fileResolver->loadFiles($serial = $this->getSerial());
        $matches = $fileResolver->getMatches();
        foreach ($files as $filename) {
            $this->subjectExecutor->execute($subject, $matches[$counter], $serial, $filename);
            $counter++;
        }
        $this->bunches = $this->bunches + $counter;
        $fileResolver->reset();
        $this->getSystemLogger()->debug(
            sprintf('Successfully processed subject "%s" with "%d" files)!', $subject->getId(), $counter)
        );
    }
protected function processSubject ( SubjectConfigurationInterface $ subject ) { $ counter = 0 ; $ fileResolver = $ this -> fileResolverFactory -> createFileResolver ( $ subject ) ; $ files = $ fileResolver -> loadFiles ( $ serial = $ this -> getSerial ( ) ) ; $ matches = $ fileResolver -> getMatches ( ) ; foreach ( $ files as $ filename ) { $ this -> subjectExecutor -> execute ( $ subject , $ matches [ $ counter ] , $ serial , $ filename ) ; $ counter ++ ; } $ this -> bunches = $ this -> bunches + $ counter ; $ fileResolver -> reset ( ) ; $ this -> getSystemLogger ( ) -> debug ( sprintf ( 'Successfully processed subject "%s" with "%d" files)!' , $ subject -> getId ( ) , $ counter ) ) ; }
Process the subject with the passed name/identifier.
Process the subject with the passed name / identifier .
// initialize the file counter // load the file resolver for the subject with the passed configuration // load the files // load the matches (must match the number of the found files) // iterate through all CSV files and process the subjects // initialize the subject and import the bunch // raise the number of the imported files // raise the bunch number by the number of imported files // reset the file resolver for making it ready parsing the files of the next subject // and and log a message that the subject has been processed