/** * Collect all system config paths where current template is currently used * * @return array */ public function getSystemConfigPathsWhereUsedCurrently() { $templateId = $this->getId(); if (!$templateId) { return array(); } $templatePaths = $this->_structure->getFieldPathsByAttribute('source_model', 'Magento\\Backend\\Model\\Config\\Source\\Email\\Template'); if (!count($templatePaths)) { return array(); } $configData = $this->_getResource()->getSystemConfigByPathsAndTemplateId($templatePaths, $templateId); if (!$configData) { return array(); } return $configData; }
/** * @param $attributeName * @param $attributeValue * @param $paths * @dataProvider getFieldPathsByAttributeDataProvider */ public function testGetFieldPathsByAttribute($attributeName, $attributeValue, $paths) { $this->assertEquals($paths, $this->_model->getFieldPathsByAttribute($attributeName, $attributeValue)); }