public function generateModel($packageKey, $modelName, array $fieldDefinitions, $overwrite = false)
    {
        list($baseNamespace, $namespaceEntryPath) = $this->getPrimaryNamespaceAndEntryPath($this->packageManager->getPackage($packageKey));
        $modelName = ucfirst($modelName);
        $namespace = trim($baseNamespace, '\\') . '\\Domain\\Model';
        $fieldDefinitions = $this->normalizeFieldDefinitions($fieldDefinitions, $namespace);

        $templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Model/EntityTemplate.php.tmpl';

        $contextVariables = [];
        $contextVariables['packageKey'] = $packageKey;
        $contextVariables['modelName'] = $modelName;
        $contextVariables['fieldDefinitions'] = $fieldDefinitions;
        $contextVariables['namespace'] = $namespace;

        $fileContent = $this->renderTemplate($templatePathAndFilename, $contextVariables);

        $modelFilename = $modelName . '.php';
        $modelPath = $namespaceEntryPath . '/Domain/Model/';
        $targetPathAndFilename = $modelPath . $modelFilename;

        $this->generateFile($targetPathAndFilename, $fileContent, $overwrite);

        $this->generateTestsForModel($packageKey, $modelName, $overwrite);

        return $this->generatedFiles;
    }