$this->eventManager =
$eventManager;
} /**
* Function which generates a new shopware theme
* into the engine/Shopware/Themes directory.
*
* @throws Exception
*/
public function generateTheme(array
$data, ?Template
$parent = null
) { if (!
is_writable($this->pathResolver->
getFrontendThemeDirectory())) { throw new Exception(sprintf('Theme directory %s isn\'t writable',
$this->pathResolver->
getFrontendThemeDirectory()));
} if (!
isset($data['template'
]) ||
empty($data['template'
])) { throw new Exception('Passed data array contains no valid theme name under the array key "template".'
);
} // Ensure that the first character is upper case.
// Required for the directory structure and php namespace
$data['template'
] =
ucfirst($data['template'
]);
$this->
createThemeDirectory($data['template'
]);