GeneratorService
class GeneratorService (View source)
Service for the Kickstart generator
Properties
protected ObjectManagerInterface | $objectManager | ||
protected PackageManager | $packageManager | ||
protected Inflector | $inflector | ||
protected ReflectionService | $reflectionService | ||
protected array | $generatedFiles |
Methods
Generate a controller with the given name for the given package
Generate an Action Controller with pre-made CRUD methods
Generate a command controller with the given name for the given package
Generate a view with the given name for the given package and controller
Generate a default layout
Generate a Fusion with the given name for the given package and controller
Generate a default page prototype
Generate a model for the package with the given model name and fields
Generate a dummy testcase for a model for the package with the given model name
Generate a repository for a model given a model name and package key
Generate a documentation skeleton for the package key
Generate translation for the package key
Normalize types and prefix types with namespaces
Generate a file with the given content and add it to the generated files
Render the given template file with the given variables
Details
array
generateActionController(string $packageKey, string $subpackage, string $controllerName, bool $fusionView = false, bool $overwrite = false)
Generate a controller with the given name for the given package
array
generateCrudController(string $packageKey, string $subpackage, string $controllerName, bool $fusionView = false, bool $overwrite = false)
Generate an Action Controller with pre-made CRUD methods
array
generateCommandController(string $packageKey, string $controllerName, bool $overwrite = false)
Generate a command controller with the given name for the given package
array
generateView(string $packageKey, string $subpackage, string $controllerName, string $viewName, string $templateName, bool $overwrite = false)
Generate a view with the given name for the given package and controller
array
generateLayout(string $packageKey, string $layoutName, bool $overwrite = false)
Generate a default layout
array
generateFusion(string $packageKey, string $subpackage, string $controllerName, string $viewName, string $templateName, bool $overwrite = false)
Generate a Fusion with the given name for the given package and controller
array
generatePrototype(string $packageKey, string $layoutName, bool $overwrite = false)
Generate a default page prototype
array
generateModel(string $packageKey, string $modelName, array $fieldDefinitions, bool $overwrite = false)
Generate a model for the package with the given model name and fields
array
generateTestsForModel(string $packageKey, string $modelName, bool $overwrite = false)
Generate a dummy testcase for a model for the package with the given model name
array
generateRepository(string $packageKey, string $modelName, bool $overwrite = false)
Generate a repository for a model given a model name and package key
array
generateDocumentation(string $packageKey)
Generate a documentation skeleton for the package key
array
generateTranslation(string $packageKey, string $sourceLanguageKey, array $targetLanguageKeys = [])
Generate translation for the package key
protected array
normalizeFieldDefinitions(array $fieldDefinitions, string $namespace = '')
Normalize types and prefix types with namespaces
protected void
generateFile(string $targetPathAndFilename, string $fileContent, bool $force = false)
Generate a file with the given content and add it to the generated files
protected string
renderTemplate(string $templatePathAndFilename, array $contextVariables)
Render the given template file with the given variables
protected array
getPrimaryNamespaceAndEntryPath(PackageInterface $package)
No description