public function testSubModuleFilter() { $manager = new ModuleManager(); $subModule = new SubModule('sub', 'parent'); $manager->registerModule($subModule); $manager->registerModule(new AdministrationModule('admin')); $manager->registerModule(new ContentModule('content')); $this->assertEquals(array($subModule), array_values($manager->getSubmodules('parent'))); }
/** * @param FormEvent $event */ public function load(FormEvent $event) { $data = $event->getData(); $patterns = $this->getRepo()->findAll(); foreach ($this->moduleManager->getContentModules() as $module) { if (!$module instanceof NodeModuleInterface) { continue; } $data[$this->getModuleId($module->getIdentifier())] = '{title}'; foreach ($this->moduleManager->getSubmodules($module->getIdentifier()) as $submodule) { $data[$this->getModuleId($submodule->getIdentifier())] = '{title}'; } } /** @var AliasPattern $pattern */ foreach ($patterns as $pattern) { $data[$this->getModuleId($pattern->getModuleIdentifier())] = $pattern->getPattern(); } $event->setData($data); }