public function generateRepository($packageKey, $modelName, $overwrite = false)
    {
        list($baseNamespace, $namespaceEntryPath) = $this->getPrimaryNamespaceAndEntryPath($this->packageManager->getPackage($packageKey));
        $modelName = ucfirst($modelName);
        $repositoryClassName = $modelName . 'Repository';
        $namespace = trim($baseNamespace, '\\') . '\\Domain\\Repository';

        $templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Repository/RepositoryTemplate.php.tmpl';

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

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

        $repositoryFilename = $repositoryClassName . '.php';
        $repositoryPath = Files::concatenatePaths([$namespaceEntryPath, 'Domain/Repository']) . '/';
        $targetPathAndFilename = $repositoryPath . $repositoryFilename;

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

        return $this->generatedFiles;
    }
public function generateRepository($packageKey, $modelName, $overwrite = false)
    {
        list($baseNamespace, $namespaceEntryPath) = $this->getPrimaryNamespaceAndEntryPath($this->packageManager->getPackage($packageKey));
        $modelName = ucfirst($modelName);
        $repositoryClassName = $modelName . 'Repository';
        $namespace = trim($baseNamespace, '\\') . '\\Domain\\Repository';

        $templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Repository/RepositoryTemplate.php.tmpl';

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

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

        $repositoryFilename = $repositoryClassName . '.php';
        $repositoryPath = Files::concatenatePaths([$namespaceEntryPath, 'Domain/Repository']) . '/';
        $targetPathAndFilename = $repositoryPath . $repositoryFilename;

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

        return $this->generatedFiles;
    }
public function generateRepository ( $ packageKey , $ modelName , $ overwrite = false ) { list ( $ baseNamespace , $ namespaceEntryPath ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ modelName = ucfirst ( $ modelName ) ; $ repositoryClassName = $ modelName . 'Repository' ; $ namespace = trim ( $ baseNamespace , '\\' ) . '\\Domain\\Repository' ; $ templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/Repository/RepositoryTemplate.php.tmpl' ; $ contextVariables = [ ] ; $ contextVariables [ 'packageKey' ] = $ packageKey ; $ contextVariables [ 'modelName' ] = $ modelName ; $ contextVariables [ 'repositoryClassName' ] = $ repositoryClassName ; $ contextVariables [ 'namespace' ] = $ namespace ; $ fileContent = $ this -> renderTemplate ( $ templatePathAndFilename , $ contextVariables ) ; $ repositoryFilename = $ repositoryClassName . '.php' ; $ repositoryPath = Files :: concatenatePaths ( [ $ namespaceEntryPath , 'Domain/Repository' ] ) . '/' ; $ targetPathAndFilename = $ repositoryPath . $ repositoryFilename ; $ this -> generateFile ( $ targetPathAndFilename , $ fileContent , $ overwrite ) ; return $ this -> generatedFiles ; }
Generate a repository for a model given a model name and package key

@param string $packageKey The package key
@param string $modelName The name of the model
@param boolean $overwrite Overwrite any existing files?
@return array An array of generated filenames
Generate a repository for a model given a model name and package key