PHP Class Neos\Kickstarter\Command\KickstartCommandController

Inheritance: extends Neos\Flow\Cli\CommandController
Show file Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$generatorService Neos\Kickstarter\Service\GeneratorService
$packageManager Neos\Flow\Package\PackageManagerInterface

Public Methods

Method Description
actionControllerCommand ( string $packageKey, string $controllerName, boolean $generateActions = false, boolean $generateTemplates = true, boolean $generateRelated = false, boolean $force = false ) : string Kickstart a new action controller
commandControllerCommand ( string $packageKey, string $controllerName, boolean $force = false ) : string Kickstart a new command controller
documentationCommand ( string $packageKey ) : string Kickstart documentation
modelCommand ( string $packageKey, string $modelName, boolean $force = false ) : string Kickstart a new domain model
packageCommand ( string $packageKey ) : string Kickstart a new package
repositoryCommand ( string $packageKey, string $modelName, boolean $force = false ) : string Kickstart a new domain repository

Protected Methods

Method Description
validateModelName ( string $modelName ) : boolean Check the given model name to be not one of the reserved words of PHP.
validatePackageKey ( string $packageKey ) : void Checks the syntax of the given $packageKey and quits with an error message if it's not valid

Method Details

actionControllerCommand() public method

Generates an Action Controller with the given name in the specified package. In its default mode it will create just the controller containing a sample indexAction. By specifying the --generate-actions flag, this command will also create a set of actions. If no model or repository exists which matches the controller name (for example "CoffeeRepository" for "CoffeeController"), an error will be shown. Likewise the command exits with an error if the specified package does not exist. By using the --generate-related flag, a missing package, model or repository can be created alongside, avoiding such an error. By specifying the --generate-templates flag, this command will also create matching Fluid templates for the actions created. This option can only be used in combination with --generate-actions. The default behavior is to not overwrite any existing code. This can be overridden by specifying the --force flag.
public actionControllerCommand ( string $packageKey, string $controllerName, boolean $generateActions = false, boolean $generateTemplates = true, boolean $generateRelated = false, boolean $force = false ) : string
$packageKey string The package key of the package for the new controller with an optional subpackage, (e.g. "MyCompany.MyPackage/Admin").
$controllerName string The name for the new controller. This may also be a comma separated list of controller names.
$generateActions boolean Also generate index, show, new, create, edit, update and delete actions.
$generateTemplates boolean Also generate the templates for each action.
$generateRelated boolean Also create the mentioned package, related model and repository if neccessary.
$force boolean Overwrite any existing controller or template code. Regardless of this flag, the package, model and repository will never be overwritten.
return string

commandControllerCommand() public method

Creates a new command controller with the given name in the specified package. The generated controller class already contains an example command.
public commandControllerCommand ( string $packageKey, string $controllerName, boolean $force = false ) : string
$packageKey string The package key of the package for the new controller
$controllerName string The name for the new controller. This may also be a comma separated list of controller names.
$force boolean Overwrite any existing controller.
return string

documentationCommand() public method

Generates a documentation skeleton for the given package.
public documentationCommand ( string $packageKey ) : string
$packageKey string The package key of the package for the documentation
return string

modelCommand() public method

This command generates a new domain model class. The fields are specified as a variable list of arguments with field name and type separated by a colon (for example "title:string" "size:int" "type:MyType").
public modelCommand ( string $packageKey, string $modelName, boolean $force = false ) : string
$packageKey string The package key of the package for the domain model
$modelName string The name of the new domain model class
$force boolean Overwrite any existing model.
return string

packageCommand() public method

Creates a new package and creates a standard Action Controller and a sample template for its Index Action. For creating a new package without sample code use the package:create command.
public packageCommand ( string $packageKey ) : string
$packageKey string The package key, for example "MyCompany.MyPackageName"
return string

repositoryCommand() public method

This command generates a new domain repository class for the given model name.
public repositoryCommand ( string $packageKey, string $modelName, boolean $force = false ) : string
$packageKey string The package key
$modelName string The name of the domain model class
$force boolean Overwrite any existing repository.
return string

validateModelName() protected method

Check the given model name to be not one of the reserved words of PHP.
See also: http://www.php.net/manual/en/reserved.keywords.php
protected validateModelName ( string $modelName ) : boolean
$modelName string
return boolean

validatePackageKey() protected method

Checks the syntax of the given $packageKey and quits with an error message if it's not valid
protected validatePackageKey ( string $packageKey ) : void
$packageKey string
return void

Property Details

$generatorService protected property

protected GeneratorService,Neos\Kickstarter\Service $generatorService
return Neos\Kickstarter\Service\GeneratorService

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface