PHP Class Iber\Generator\Commands\MakeModelsCommand

Inheritance: extends Illuminate\Console\GeneratorCommand
Afficher le fichier Open project: ignasbernotas/laravel-model-generator

Protected Properties

Свойство Type Description
$databaseEngine string
$description string The console command description.
$extends string Default class the model extends.
$fillableRules array Rules for columns that go into the fillable list.
$getFunctionStub string Contains the template stub for get function
$guardedRules array Rules for columns that go into the guarded list.
$name string The console command name.
$namespace string Default model namespace.
$ruleProcessor Rule processor class instance.
$setFunctionStub string Contains the template stub for set function
$timestampRules array Rules for columns that set whether the timestamps property is set to true/false.

Méthodes publiques

Méthode Description
fire ( ) : mixed Execute the console command.
getStub ( ) : string Get stub file location.

Méthodes protégées

Méthode Description
generateTable ( $table ) : void Generate a model file from a database table.
getArguments ( ) : array Get the console command arguments.
getOptions ( ) : array Get the console command options.
getSchemaTables ( ) : array Get schema tables.
getTableColumns ( $table ) : array Get table columns.
getTablePrimaryKey ( $table ) : string Get table primary key column.
getTableProperties ( $table ) : array Fill up $fillable/$guarded/$timestamps properties based on table columns.
replaceTokens ( $name, $table ) : mixed | string Replace all stub tokens with properties.
replaceTokensWithSetGetFunctions ( array $properties, string $class ) : string Replaces setters and getters from the stub. The functions are created from provider properties.

Method Details

fire() public méthode

Execute the console command.
public fire ( ) : mixed
Résultat mixed

generateTable() protected méthode

Generate a model file from a database table.
protected generateTable ( $table ) : void
$table
Résultat void

getArguments() protected méthode

Get the console command arguments.
protected getArguments ( ) : array
Résultat array

getOptions() protected méthode

Get the console command options.
protected getOptions ( ) : array
Résultat array

getSchemaTables() protected méthode

Get schema tables.
protected getSchemaTables ( ) : array
Résultat array

getStub() public méthode

Get stub file location.
public getStub ( ) : string
Résultat string

getTableColumns() protected méthode

Get table columns.
protected getTableColumns ( $table ) : array
$table
Résultat array

getTablePrimaryKey() protected méthode

Get table primary key column.
protected getTablePrimaryKey ( $table ) : string
$table
Résultat string

getTableProperties() protected méthode

Fill up $fillable/$guarded/$timestamps properties based on table columns.
protected getTableProperties ( $table ) : array
$table
Résultat array

replaceTokens() protected méthode

Replace all stub tokens with properties.
protected replaceTokens ( $name, $table ) : mixed | string
$name
$table
Résultat mixed | string

replaceTokensWithSetGetFunctions() protected méthode

Replaces setters and getters from the stub. The functions are created from provider properties.
protected replaceTokensWithSetGetFunctions ( array $properties, string $class ) : string
$properties array
$class string
Résultat string

Property Details

$databaseEngine protected_oe property

protected string $databaseEngine
Résultat string

$description protected_oe property

The console command description.
protected string $description
Résultat string

$extends protected_oe property

Default class the model extends.
protected string $extends
Résultat string

$fillableRules protected_oe property

Rules for columns that go into the fillable list.
protected array $fillableRules
Résultat array

$getFunctionStub protected_oe property

Contains the template stub for get function
protected string $getFunctionStub
Résultat string

$guardedRules protected_oe property

Rules for columns that go into the guarded list.
protected array $guardedRules
Résultat array

$name protected_oe property

The console command name.
protected string $name
Résultat string

$namespace protected_oe property

Default model namespace.
protected string $namespace
Résultat string

$ruleProcessor protected_oe property

Rule processor class instance.
protected $ruleProcessor

$setFunctionStub protected_oe property

Contains the template stub for set function
protected string $setFunctionStub
Résultat string

$timestampRules protected_oe property

Rules for columns that set whether the timestamps property is set to true/false.
protected array $timestampRules
Résultat array