/** * {@inheritdoc} */ public function generate() { foreach ($this->elementStorage->getNamespaces() as $name => $namespace) { $template = $this->templateFactory->createNamedForElement(TemplateFactory::ELEMENT_NAMESPACE, $name); $template = $this->namespaceAndPackageLoader->loadTemplateWithNamespace($template, $name, $namespace); $template->save(); $this->eventDispatcher->dispatch(new GenerateProgressEvent(GeneratorEvents::ON_GENERATE_PROGRESS)); } }
public function generate() { foreach ($this->elementStorage->getElements() as $type => $elementList) { foreach ($elementList as $element) { /** @var ElementReflectionInterface $element */ if ($element->isTokenized()) { $this->generateForElement($element); $this->eventDispatcher->dispatch(new GenerateProgressEvent(GeneratorEvents::ON_GENERATE_PROGRESS)); } } } }