/** * @param ConfigurationAdapter $config_adapter * @param bool $environment * @return ConfigYaml */ public static function build(ConfigurationAdapter $config_adapter, $environment = false) { $data_structure = array(); foreach ($config_adapter->getAllValues() as $row) { $scope = $row['scope']; $scope_id = $row['scope_id']; $path = $row['path']; $value = $row['value']; $scope_key = self::buildScopeKey($scope, $scope_id); if (!isset($data_structure[$scope_key])) { $data_structure[$scope_key] = array(); } $data_structure[$scope_key][$path] = $value; } return new ConfigYaml($data_structure, $environment); }