structure = $structure; parent::__construct( $context, $design, $registry, $appEmulation, $storeManager, $assetRepo, $filesystem, $scopeConfig, $emailConfig, $templateFactory, $filterManager, $urlModel, $filterFactory, $data, $serializer ); } /** * Collect all system config paths where current template is currently used * * @return array */ public function getSystemConfigPathsWhereCurrentlyUsed() { $templateId = $this->getId(); if (!$templateId) { return []; } $templatePaths = $this->structure->getFieldPathsByAttribute( 'source_model', \Magento\Config\Model\Config\Source\Email\Template::class ); if (!count($templatePaths)) { return []; } $configData = $this->_getResource()->getSystemConfigByPathsAndTemplateId($templatePaths, $templateId); foreach ($templatePaths as $path) { if ($this->scopeConfig->getValue($path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) == $templateId) { foreach ($configData as $data) { if ($data['path'] == $path) { continue 2; // don't add final fallback value if it was found in stored config } } $configData[] = [ 'scope' => ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 'path' => $path ]; } } return $configData; } }