| Methods |
public
|
__construct(string $sourceCode, bool $overwrite = false, bool $useAttributesForDoctrineMapping = true)
|
#
|
public
|
setIo(ConsoleStyle $io): void
|
#
|
public
|
getSourceCode(): string
|
#
|
public
|
addEntityField(string $propertyName, array $columnOptions, array $comments = []): void
|
#
|
public
|
addEmbeddedEntity(string $propertyName, string $className): void
|
#
|
public
|
addManyToOneRelation(RelationManyToOne $manyToOne): void
|
#
|
public
|
addOneToOneRelation(RelationOneToOne $oneToOne): void
|
#
|
public
|
addOneToManyRelation(RelationOneToMany $oneToMany): void
|
#
|
public
|
addManyToManyRelation(RelationManyToMany $manyToMany): void
|
#
|
public
|
addInterface(string $interfaceName): void
|
#
|
public
|
addTrait(string $trait): void
Parameters
| $trait |
the fully-qualified trait name
|
|
#
|
public
|
addAccessorMethod(
string $propertyName,
string $methodName,
$returnType,
bool $isReturnTypeNullable,
array $commentLines = [],
$typeCast = null,
): void
|
#
|
public
|
addGetter(string $propertyName, $returnType, bool $isReturnTypeNullable, array $commentLines = []): void
|
#
|
public
|
addSetter(string $propertyName, ?string $type, bool $isNullable, array $commentLines = []): void
|
#
|
public
|
addConstructor(Node[] $params, string $methodBody): void
|
#
|
public
|
addMethodBuilder(Method $methodBuilder, Node[] $params = [], string $methodBody = null): void
|
#
|
public
|
addMethodBody(Method $methodBuilder, string $methodBody): void
|
#
|
public
|
createMethodBuilder(string $methodName, $returnType, bool $isReturnTypeNullable, array $commentLines = []): Method
|
#
|
public
|
createMethodLevelCommentNode(string $comment)
|
#
|
public
|
createMethodLevelBlankLine()
|
#
|
public
|
addProperty(
string $name,
$defaultValue = self::DEFAULT_VALUE_NONE,
array<Attribute|AttributeGroup> $attributes = [],
array $comments = [],
string $propertyType = null,
): void
|
#
|
public
|
addAttributeToClass(string $attributeClass, array $options): void
|
#
|
private
|
addCustomGetter(
string $propertyName,
string $methodName,
$returnType,
bool $isReturnTypeNullable,
array $commentLines = [],
$typeCast = null,
): void
|
#
|
private
|
createSetterNodeBuilder(string $propertyName, $type, bool $isNullable, array $commentLines = []): Method
|
#
|
private
|
addSingularRelation(BaseRelation $relation): void
|
#
|
private
|
addCollectionRelation(BaseCollectionRelation $relation): void
|
#
|
private
|
addStatementToConstructor(Stmt $stmt): void
|
#
|
private
|
getConstructorNode(): ?ClassMethod
|
#
|
public
|
addUseStatementIfNecessary(string $class): string
Returns
The alias to use when referencing this class
|
#
|
public
|
buildAttributeNode(string $attributeClass, array $options, ?string $attributePrefix = null): Attribute
Builds a PHPParser attribute node.
Builds a PHPParser attribute node.
Parameters
| $attributeClass |
The attribute class which should be used for the attribute E.g. #[Column()]
|
| $options |
The named arguments for the attribute ($key = argument name, $value = argument value)
|
| $attributePrefix |
If a prefix is provided, the node is built using the prefix. E.g. #[ORM\Column()]
|
|
#
|
private
|
updateSourceCodeFromNewStmts(): void
|
#
|
private
|
setSourceCode(string $sourceCode): void
|
#
|
private
|
getClassNode(): Class_
|
#
|
private
|
getNamespaceNode(): Namespace_
|
#
|
private
|
findFirstNode(callable $filterCallback): ?Node
|
#
|
private
|
findLastNode(callable $filterCallback, array $ast): ?Node
|
#
|
private
|
findAllNodes(callable $filterCallback): Node[]
|
#
|
private
|
createBlankLineNode(string $context): Use_|Node|Property|Variable
|
#
|
private
|
createSingleLineCommentNode(string $comment, string $context): Stmt
|
#
|
private
|
createDocBlock(array $commentLines): string
|
#
|
private
|
addMethod(ClassMethod $methodNode): void
|
#
|
private
|
makeMethodFluent(Method $methodBuilder): void
|
#
|
private
|
isInSameNamespace(string $class): bool
|
#
|
private
|
getThisFullClassName(): string
|
#
|
private
|
addNodeAfterProperties(Node $newNode): void
Adds this new node where a new property should go.
Adds this new node where a new property should go.
Useful for adding properties, or adding a constructor.
|
#
|
private
|
createNullConstant(): ConstFetch
|
#
|
private
|
addNodesToSetOtherSideOfOneToOne(RelationOneToOne $relation, Method $setterNodeBuilder): void
|
#
|
private
|
methodExists(string $methodName): bool
|
#
|
private
|
getMethodIndex(string $methodName)
|
#
|
private
|
propertyExists(string $propertyName): bool
|
#
|
private
|
writeNote(string $note): void
|
#
|
private
|
addMethodParams(Method $methodBuilder, array $params): void
|
#
|
private
|
buildNodeExprByValue(mixed $value): Expr
builds a PHPParser Expr Node based on the value given in $value
throws an Exception when the given $value is not…
builds a PHPParser Expr Node based on the value given in $value
throws an Exception when the given $value is not resolvable by this method.
Throws
|
#
|
private
|
sortOptionsByClassConstructorParameters(array $options, string $classString): array
sort the given options based on the constructor parameters for the given $classString
this prevents code inspections…
sort the given options based on the constructor parameters for the given $classString
this prevents code inspections warnings for IDEs like intellij/phpstorm.
option keys that are not found in the constructor will be added at the end of the sorted array
|
#
|