src/Plugins/SubjectPlugin.php
/**
     * Process the plugin functionality.
     *
     * @return void
     * @throws \Exception Is thrown, if the plugin can not be processed
     */
Process the plugin functionality.
@return void
@throws \Exception Is thrown, if the plugin can not be processed
Process the plugin functionality . @return void @throws \ Exception Is thrown if the plugin can not be processed
public function process()
    {
        try {
            $subjects = $this->getPluginConfiguration()->getSubjects();
            $status = array();
            foreach ($subjects as $subject) {
                $status[$subject->getPrefix()] = array();
            }
            $this->getRegistryProcessor()->mergeAttributesRecursive(RegistryKeys::STATUS, $status);
            foreach ($subjects as $subject) {
                $this->processSubject($subject);
            }
            $this->getRegistryProcessor()->mergeAttributesRecursive(
                RegistryKeys::STATUS,
                array(
                    RegistryKeys::BUNCHES => $this->bunches
                )
            );
        } catch (MissingOkFileException $mofe) {
            $this->getApplication()->finish($mofe->getMessage());
        } catch (\Exception $e) {
            throw $e;
        }
    }
public function process ( ) { try { $ subjects = $ this -> getPluginConfiguration ( ) -> getSubjects ( ) ; $ status = array ( ) ; foreach ( $ subjects as $ subject ) { $ status [ $ subject -> getPrefix ( ) ] = array ( ) ; } $ this -> getRegistryProcessor ( ) -> mergeAttributesRecursive ( RegistryKeys :: STATUS , $ status ) ; foreach ( $ subjects as $ subject ) { $ this -> processSubject ( $ subject ) ; } $ this -> getRegistryProcessor ( ) -> mergeAttributesRecursive ( RegistryKeys :: STATUS , array ( RegistryKeys :: BUNCHES => $ this -> bunches ) ) ; } catch ( MissingOkFileException $ mofe ) { $ this -> getApplication ( ) -> finish ( $ mofe -> getMessage ( ) ) ; } catch ( \ Exception $ e ) { throw $ e ; } }
Process the plugin functionality.
Process the plugin functionality .
// load the plugin's subjects // initialize the array for the status // initialize the status information for the subjects /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */ // and update it in the registry // process all the subjects found in the system configuration /** @var \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject */ // update the number of imported bunches // finish the application if we can't find the mandatory OK file // re-throw the exception