CreateModel

 class System\Console\CreateModel
extends System\Console\BaseScaffoldCommand
implements 
    Symfony\Component\Console\Command\SignalableCommandInterface

Extends

Class Description
BaseScaffoldCommand

Traits

Trait Description
HandlesCleanup

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

HasPluginArgument

Console Command Trait that provides autocompletion for the "plugin" argument

ProvidesAutocompletion

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

Properties

protected static $defaultName : string | null

The default command name for lazy loading.

protected $description : string

The console command description.

protected $nameFrom : string

The argument that the generated class name comes from

protected $replaces : array

List of commands that this command replaces (aliases)

protected $signature : string

The name and signature of this command.

protected $stubs : array

A mapping of stubs to generated files.

protected $type : string

The type of class being generated.

inherited protected $files : Winter\Storm\Filesystem\Filesystem

Inherited from BaseScaffoldCommand

The filesystem instance.

inherited protected $laravel : Winter\Storm\Foundation\Application

Inherited from BaseScaffoldCommand

inherited protected $reservedNames : string[]

Inherited from BaseScaffoldCommand

Reserved names that cannot be used for generation.

inherited protected $vars : array

Inherited from BaseScaffoldCommand

An array of variables to use in stubs.

Methods

public createController ()

Create a controller for the model.

Returns
mixed

public createMigration ()

Create a migration for the model.

Returns
mixed

public createSeeder ()

Create a seeder for the model.

Returns
mixed

public handle () : void

Execute the console command.

Returns
void

protected getLangKeys () : array

Gets the localization keys and values to be stored in the plugin's localization files Can reference $this->vars and $this->laravel->getLocale() internally

Returns
array

protected processVars ($vars) : array

Adds controller & model lang helpers to the vars

Parameters
Property Description
$vars
mixed
Returns
array

inherited public __construct () : void

Inherited from BaseScaffoldCommand

Create a new controller creator command instance.

Returns
void

inherited public alert (string $string, int | string | null $verbosity = null) : void

Inherited from BaseScaffoldCommand

Write a string in an alert box.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

inherited public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void

Inherited from BaseScaffoldCommand

Provide autocompletion for this command's input

Parameters
Property Description
$input
Symfony\Component\Console\Completion\CompletionInput
$suggestions
Symfony\Component\Console\Completion\CompletionSuggestions
Returns
void

inherited public error (string $string, int | string | null $verbosity = null) : void

Inherited from BaseScaffoldCommand

Write a string as error output.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

inherited public getPlugin ($identifier = null) : System\Classes\PluginBase | null

Inherited from BaseScaffoldCommand

Get the plugin instance for the input.

Parameters
Property Description
$identifier
mixed
Returns
System\Classes\PluginBase | null

inherited public getPluginIdentifier ($identifier = null) : string

Inherited from BaseScaffoldCommand

Get the desired plugin name from the input.

Parameters
Property Description
$identifier
mixed
Returns
string

inherited public getSubscribedSignals () : array

Inherited from BaseScaffoldCommand

Returns the process signals this command listens to

Returns
array

inherited public handleSignal (integer $signal) : void

Inherited from BaseScaffoldCommand

Handle the provided Unix process signal

Parameters
Property Description
$signal
integer
Returns
void

inherited public handleWindowsSignal (integer $event) : void

Inherited from BaseScaffoldCommand

Handle the provided Windows process singal.

Parameters
Property Description
$event
integer
Returns
void

inherited public makeStub (string $stubName)

Inherited from BaseScaffoldCommand

Make a single stub.

Parameters
Property Description
$stubName
string

The source filename for the stub.

Returns
mixed

inherited public makeStubs () : void

Inherited from BaseScaffoldCommand

Make all stubs.

Returns
void

inherited public suggestPluginValues ()

Inherited from BaseScaffoldCommand

Return available plugins for autocompletion of the "plugin" argument

Returns
mixed

inherited protected getDestinationForStub (string $stubName) : string

Inherited from BaseScaffoldCommand

Get the destination path for the provided stub name

Parameters
Property Description
$stubName
string
Returns
string

inherited protected getDestinationPath () : string

Inherited from BaseScaffoldCommand

Get the base path to output generated stubs to

Returns
string

inherited protected getNameInput () : string

Inherited from BaseScaffoldCommand

Get the desired class name from the input.

Returns
string

inherited protected getSourcePath () : string

Inherited from BaseScaffoldCommand

Get the base path to source stub files from

Returns
string

inherited protected isReservedName (string $name) : bool

Inherited from BaseScaffoldCommand

Checks whether the given name is reserved.

Parameters
Property Description
$name
string
Returns
bool

inherited protected makeDirectory (string $path) : void

Inherited from BaseScaffoldCommand

Build the directory for the class if necessary.

Parameters
Property Description
$path
string
Returns
void

inherited protected modifyString (string | array $type, string $string) : string

Inherited from BaseScaffoldCommand

Internal helper that handles modify a string, with extra logic.

Parameters
Property Description
$type
string | array
$string
string
Returns
string

inherited protected prepareVars () : array

Inherited from BaseScaffoldCommand

Prepare variables for stubs.

Returns
array
Copyright © 2024 Winter CMS