MakeEntity
extends AbstractMaker
in package
implements
InputAwareMakerInterface
FinalYes
Convenient abstract class for makers.
Tags
Table of Contents
Interfaces
- InputAwareMakerInterface
- Lets the configureDependencies method access to the command's input.
Properties
- $doctrineHelper : DoctrineHelper
- $entityClassGenerator : EntityClassGenerator
- $fileManager : FileManager
- $generator : Generator
- $phpCompatUtil : PhpCompatUtil
Methods
- __construct() : mixed
- configureCommand() : void
- configureDependencies() : void
- Configure any library dependencies that your maker requires.
- generate() : void
- getCommandDescription() : string
- getCommandName() : string
- interact() : void
- If necessary, you can use this method to interactively ask the user for input.
- addDependencies() : string
- writeSuccessMessage() : void
- askForNextField() : EntityRelation|array<string|int, mixed>|null
- askRelationDetails() : EntityRelation
- askRelationType() : mixed
- createClassManipulator() : ClassSourceManipulator
- createEntityClassQuestion() : Question
- doesEntityUseAttributeMapping() : bool
- getEntityNamespace() : string
- getPathOfClass() : string
- getPropertyNames() : array<string|int, mixed>
- getTypesMap() : array<string|int, mixed>
- isClassInVendor() : bool
- printAvailableTypes() : void
- regenerateEntities() : void
Properties
$doctrineHelper
private
DoctrineHelper
$doctrineHelper
$entityClassGenerator
private
EntityClassGenerator
$entityClassGenerator
$fileManager
private
FileManager
$fileManager
$generator
private
Generator
$generator
$phpCompatUtil
private
PhpCompatUtil
$phpCompatUtil
Methods
__construct()
public
__construct(FileManager $fileManager, DoctrineHelper $doctrineHelper[, string $projectDirectory = null ][, Generator $generator = null ][, EntityClassGenerator $entityClassGenerator = null ][, PhpCompatUtil $phpCompatUtil = null ]) : mixed
Parameters
- $fileManager : FileManager
- $doctrineHelper : DoctrineHelper
- $projectDirectory : string = null
- $generator : Generator = null
- $entityClassGenerator : EntityClassGenerator = null
- $phpCompatUtil : PhpCompatUtil = null
configureCommand()
public
configureCommand(Command $command, InputConfiguration $inputConfig) : void
Parameters
- $command : Command
- $inputConfig : InputConfiguration
configureDependencies()
Configure any library dependencies that your maker requires.
public
configureDependencies(DependencyBuilder $dependencies[, InputInterface $input = null ]) : void
Parameters
- $dependencies : DependencyBuilder
- $input : InputInterface = null
generate()
public
generate(InputInterface $input, ConsoleStyle $io, Generator $generator) : void
Parameters
- $input : InputInterface
- $io : ConsoleStyle
- $generator : Generator
getCommandDescription()
public
static getCommandDescription() : string
Return values
stringgetCommandName()
public
static getCommandName() : string
Return values
stringinteract()
If necessary, you can use this method to interactively ask the user for input.
public
interact(InputInterface $input, ConsoleStyle $io, Command $command) : void
Parameters
- $input : InputInterface
- $io : ConsoleStyle
- $command : Command
addDependencies()
protected
addDependencies(array<string|int, mixed> $dependencies[, string $message = null ]) : string
Parameters
- $dependencies : array<string|int, mixed>
- $message : string = null
Return values
stringwriteSuccessMessage()
protected
writeSuccessMessage(ConsoleStyle $io) : void
Parameters
- $io : ConsoleStyle
askForNextField()
private
askForNextField(ConsoleStyle $io, array<string|int, mixed> $fields, string $entityClass, bool $isFirstField) : EntityRelation|array<string|int, mixed>|null
Parameters
- $io : ConsoleStyle
- $fields : array<string|int, mixed>
- $entityClass : string
- $isFirstField : bool
Return values
EntityRelation|array<string|int, mixed>|nullaskRelationDetails()
private
askRelationDetails(ConsoleStyle $io, string $generatedEntityClass, string $type, string $newFieldName) : EntityRelation
Parameters
- $io : ConsoleStyle
- $generatedEntityClass : string
- $type : string
- $newFieldName : string
Return values
EntityRelationaskRelationType()
private
askRelationType(ConsoleStyle $io, string $entityClass, string $targetEntityClass) : mixed
Parameters
- $io : ConsoleStyle
- $entityClass : string
- $targetEntityClass : string
createClassManipulator()
private
createClassManipulator(string $path, ConsoleStyle $io, bool $overwrite) : ClassSourceManipulator
Parameters
- $path : string
- $io : ConsoleStyle
- $overwrite : bool
Return values
ClassSourceManipulatorcreateEntityClassQuestion()
private
createEntityClassQuestion(string $questionText) : Question
Parameters
- $questionText : string
Return values
QuestiondoesEntityUseAttributeMapping()
private
doesEntityUseAttributeMapping(string $className) : bool
Parameters
- $className : string
Tags
Return values
boolgetEntityNamespace()
private
getEntityNamespace() : string
Return values
stringgetPathOfClass()
private
getPathOfClass(string $class) : string
Parameters
- $class : string
Return values
stringgetPropertyNames()
private
getPropertyNames(string $class) : array<string|int, mixed>
Parameters
- $class : string
Return values
array<string|int, mixed>getTypesMap()
private
getTypesMap() : array<string|int, mixed>
Return values
array<string|int, mixed>isClassInVendor()
private
isClassInVendor(string $class) : bool
Parameters
- $class : string
Return values
boolprintAvailableTypes()
private
printAvailableTypes(ConsoleStyle $io) : void
Parameters
- $io : ConsoleStyle
regenerateEntities()
private
regenerateEntities(string $classOrNamespace, bool $overwrite, Generator $generator) : void
Parameters
- $classOrNamespace : string
- $overwrite : bool
- $generator : Generator