public function recursiveActivation(ModuleToggleActivationEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $module = ModuleQuery::create()->findPk($event->getModuleId())) {
            $moduleValidator = new ModuleValidator($module->getAbsoluteBaseDir());
            $dependencies = $moduleValidator->getCurrentModuleDependencies();
            foreach ($dependencies as $defMod) {
                $submodule = ModuleQuery::create()
                    ->findOneByCode($defMod["code"]);
                if ($submodule && $submodule->getActivate() != BaseModule::IS_ACTIVATED) {
                    $subevent = new ModuleToggleActivationEvent($submodule->getId());
                    $subevent->setRecursive(true);
                    $dispatcher->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $subevent);
                }
            }
        }
    }
public function recursiveActivation(ModuleToggleActivationEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $module = ModuleQuery::create()->findPk($event->getModuleId())) {
            $moduleValidator = new ModuleValidator($module->getAbsoluteBaseDir());
            $dependencies = $moduleValidator->getCurrentModuleDependencies();
            foreach ($dependencies as $defMod) {
                $submodule = ModuleQuery::create()
                    ->findOneByCode($defMod["code"]);
                if ($submodule && $submodule->getActivate() != BaseModule::IS_ACTIVATED) {
                    $subevent = new ModuleToggleActivationEvent($submodule->getId());
                    $subevent->setRecursive(true);
                    $dispatcher->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $subevent);
                }
            }
        }
    }
public function recursiveActivation ( ModuleToggleActivationEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { if ( null !== $ module = ModuleQuery :: create ( ) -> findPk ( $ event -> getModuleId ( ) ) ) { $ moduleValidator = new ModuleValidator ( $ module -> getAbsoluteBaseDir ( ) ) ; $ dependencies = $ moduleValidator -> getCurrentModuleDependencies ( ) ; foreach ( $ dependencies as $ defMod ) { $ submodule = ModuleQuery :: create ( ) -> findOneByCode ( $ defMod [ "code" ] ) ; if ( $ submodule && $ submodule -> getActivate ( ) != BaseModule :: IS_ACTIVATED ) { $ subevent = new ModuleToggleActivationEvent ( $ submodule -> getId ( ) ) ; $ subevent -> setRecursive ( true ) ; $ dispatcher -> dispatch ( TheliaEvents :: MODULE_TOGGLE_ACTIVATION , $ subevent ) ; } } } }
Get dependencies of the current module and activate it if needed

@param ModuleToggleActivationEvent $event
@param $eventName
@param EventDispatcherInterface $dispatcher
Get dependencies of the current module and activate it if needed