src/Plugins/SubjectPlugin.php
protected function processSubject(SubjectConfigurationInterface $subject)
    {

        // initialize the bunch number
        $bunches = 0;

        // load the file resolver for the subject with the passed configuration
        $fileResolver = $this->fileResolverFactory->createFileResolver($subject);

        // load the files
        $files = $fileResolver->loadFiles($serial = $this->getSerial());

        // iterate through all CSV files and process the subjects
        foreach ($files as $filename) {
            // query whether or not that the file is part of the actual bunch
            if ($fileResolver->shouldBeHandled($filename)) {
                // clean-up the OK file, if needed
                $fileResolver->cleanUpOkFile($filename);

                // initialize the subject and import the bunch
                $this->subjectExecutor->execute($subject, $fileResolver->getMatches(), $serial, $filename);

                // raise the number of the imported bunches
                $bunches++;
            }
        }

        // raise the bunch number by the imported bunches
        $this->bunches = $this->bunches + $bunches;

        // reset the file resolver for making it ready parsing the files of the next subject
        $fileResolver->reset();

        // and and log a message that the subject has been processed
        $this->getSystemLogger()->debug(
            sprintf('Successfully processed subject %s with %d bunch(es)!', $subject->getId(), $bunches)
        );
    }
protected function processSubject(SubjectConfigurationInterface $subject)
    {

        // initialize the bunch number
        $bunches = 0;

        // load the file resolver for the subject with the passed configuration
        $fileResolver = $this->fileResolverFactory->createFileResolver($subject);

        // load the files
        $files = $fileResolver->loadFiles($serial = $this->getSerial());

        // iterate through all CSV files and process the subjects
        foreach ($files as $filename) {
            // query whether or not that the file is part of the actual bunch
            if ($fileResolver->shouldBeHandled($filename)) {
                // clean-up the OK file, if needed
                $fileResolver->cleanUpOkFile($filename);

                // initialize the subject and import the bunch
                $this->subjectExecutor->execute($subject, $fileResolver->getMatches(), $serial, $filename);

                // raise the number of the imported bunches
                $bunches++;
            }
        }

        // raise the bunch number by the imported bunches
        $this->bunches = $this->bunches + $bunches;

        // reset the file resolver for making it ready parsing the files of the next subject
        $fileResolver->reset();

        // and and log a message that the subject has been processed
        $this->getSystemLogger()->debug(
            sprintf('Successfully processed subject %s with %d bunch(es)!', $subject->getId(), $bunches)
        );
    }
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