src/Plugins/SubjectPlugin.php
public function process()
    {

        try {
            // immediately add the PID to lock this import process
            $this->lock();

            // load the plugin's subjects
            $subjects = $this->getPluginConfiguration()->getSubjects();

            // initialize the array for the status
            $status = array();

            // initialize the status information for the subjects
            /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */
            foreach ($subjects as $subject) {
                $status[$subject->getPrefix()] = array();
            }

            // and update it in the registry
            $this->getRegistryProcessor()->mergeAttributesRecursive($this->getSerial(), $status);

            // process all the subjects found in the system configuration
            /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */
            foreach ($subjects as $subject) {
                $this->processSubject($subject);
            }

            // update the number of imported bunches
            $this->getRegistryProcessor()->mergeAttributesRecursive(
                $this->getSerial(),
                array(RegistryKeys::BUNCHES => $this->bunches)
            );

            // stop the application if we don't process ANY bunch
            if ($this->bunches === 0) {
                $this->getApplication()->stop(
                    sprintf(
                        'Operation %s has been stopped by %s, because no import files can be found in directory %s',
                        $this->getConfiguration()->getOperationName(),
                        get_class($this),
                        $this->getConfiguration()->getSourceDir()
                    )
                );
            }

            // finally, if a PID has been set (because CSV files has been found),
            // remove it from the PID file to unlock the importer
            $this->unlock();
        } catch (\Exception $e) {
            // finally, if a PID has been set (because CSV files has been found),
            // remove it from the PID file to unlock the importer
            $this->unlock();

            // re-throw the exception
            throw $e;
        }
    }
public function process()
    {

        try {
            // immediately add the PID to lock this import process
            $this->lock();

            // load the plugin's subjects
            $subjects = $this->getPluginConfiguration()->getSubjects();

            // initialize the array for the status
            $status = array();

            // initialize the status information for the subjects
            /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */
            foreach ($subjects as $subject) {
                $status[$subject->getPrefix()] = array();
            }

            // and update it in the registry
            $this->getRegistryProcessor()->mergeAttributesRecursive($this->getSerial(), $status);

            // process all the subjects found in the system configuration
            /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */
            foreach ($subjects as $subject) {
                $this->processSubject($subject);
            }

            // update the number of imported bunches
            $this->getRegistryProcessor()->mergeAttributesRecursive(
                $this->getSerial(),
                array(RegistryKeys::BUNCHES => $this->bunches)
            );

            // stop the application if we don't process ANY bunch
            if ($this->bunches === 0) {
                $this->getApplication()->stop(
                    sprintf(
                        'Operation %s has been stopped by %s, because no import files can be found in directory %s',
                        $this->getConfiguration()->getOperationName(),
                        get_class($this),
                        $this->getConfiguration()->getSourceDir()
                    )
                );
            }

            // finally, if a PID has been set (because CSV files has been found),
            // remove it from the PID file to unlock the importer
            $this->unlock();
        } catch (\Exception $e) {
            // finally, if a PID has been set (because CSV files has been found),
            // remove it from the PID file to unlock the importer
            $this->unlock();

            // re-throw the exception
            throw $e;
        }
    }
Process the plugin functionality.

@return void
@throws \Exception Is thrown, if the plugin can not be processed