public function read($scope = null)
    {
        $scope = $scope === null ? ContainerScopeInterface::SCOPE_DEFAULT : $scope;
        if ($scope !== ContainerScopeInterface::SCOPE_DEFAULT) {
            throw new \Magento\Framework\Exception\LocalizedException(__("Only default scope allowed"));
        }

        $config = $this->initialConfig->getData($scope);

        $collection = $this->collectionFactory->create(
            ['scope' => $scope]
        );

        $dbDefaultConfig = [];
        foreach ($collection as $item) {
            $dbDefaultConfig[$item->getPath()] = $item->getValue();
        }

        $dbDefaultConfig = $this->converter->convert($dbDefaultConfig);
        $config = array_replace_recursive($config, $dbDefaultConfig);

        return $config;
    }
public function read($scope = null)
    {
        $scope = $scope === null ? ContainerScopeInterface::SCOPE_DEFAULT : $scope;
        if ($scope !== ContainerScopeInterface::SCOPE_DEFAULT) {
            throw new \Magento\Framework\Exception\LocalizedException(__("Only default scope allowed"));
        }

        $config = $this->initialConfig->getData($scope);

        $collection = $this->collectionFactory->create(
            ['scope' => $scope]
        );

        $dbDefaultConfig = [];
        foreach ($collection as $item) {
            $dbDefaultConfig[$item->getPath()] = $item->getValue();
        }

        $dbDefaultConfig = $this->converter->convert($dbDefaultConfig);
        $config = array_replace_recursive($config, $dbDefaultConfig);

        return $config;
    }
public function read ( $ scope = null ) { $ scope = $ scope === null ? ContainerScopeInterface :: SCOPE_DEFAULT : $ scope ; if ( $ scope !== ContainerScopeInterface :: SCOPE_DEFAULT ) { throw new \ Magento \ Framework \ Exception \ LocalizedException ( __ ( "Only default scope allowed" ) ) ; } $ config = $ this -> initialConfig -> getData ( $ scope ) ; $ collection = $ this -> collectionFactory -> create ( [ 'scope' => $ scope ] ) ; $ dbDefaultConfig = [ ] ; foreach ( $ collection as $ item ) { $ dbDefaultConfig [ $ item -> getPath ( ) ] = $ item -> getValue ( ) ; } $ dbDefaultConfig = $ this -> converter -> convert ( $ dbDefaultConfig ) ; $ config = array_replace_recursive ( $ config , $ dbDefaultConfig ) ; return $ config ; }
Read configuration data

@param null|string $scope The current scope to load (default)

@return array Exception is thrown when scope other than default is given
@throws \Magento\Framework\Exception\LocalizedException
Read configuration data