// Iterates all configurations sets of the file system
foreach ($collection as $item) { if (!
$item instanceof ConfigSet
) { throw new Exception(sprintf("Theme %s adds a configuration set which isn't an instance of Shopware\Components\Theme\ConfigSet.",
$theme->
getTemplate()));
} $item->
validate();
// Check if this set is already defined, to prevent auto increment in the database.
$existing =
$this->
getExistingConfigSet( $template->
getConfigSets(),
$item->
getName() );
// If the set isn't defined, create a new one
if (!
$existing instanceof Set
) { $existing =
new Set();
$template->
getConfigSets()->
add($existing);
} $existing->
setTemplate($template);