SilverStripe IDE Annotations

OrmTagGenerator extends AbstractTagGenerator

OrmTagGenerator This class generates DocBlock Tags for the ORM properties of a Dataobject of DataExtension and adds $owner Tags for added DataExtensions

Table of Contents

Properties

$className  : string
The current class we are working with
$existingTags  : array<string|int, Tag>
The existing tags of the class we are working with
$pageClassesCache  : mixed
$propertyTypes  : array<string|int, mixed>
$reflector  : ReflectionClass
$tagFactory  : StandardTagFactory
$tags  : array<string|int, Tag>
List all the generated tags form the various generateSomeORMProperies methods

Methods

__construct()  : mixed
DocBlockTagGenerator constructor.
getExistingTagCommentByTagString()  : string
getExistingTags()  : array<string|int, Tag>
getSupportedTagTypes()  : array<string|int, mixed>
List of supported tags.
getTagNameForDBField()  : string
getTags()  : array<string|int, Tag>
generateBelongsManyManyTags()  : mixed
Generate the $belongs_many_many method values.
generateBelongsToTags()  : mixed
Generate the $belongs_to property values.
generateDBTags()  : mixed
Generate the $db property values.
generateExtensionsTags()  : mixed
Generate the mixins for DataExtensions.
generateHasManyTags()  : mixed
Generate the $has_many method values.
generateHasOneTags()  : mixed
Generate the $has_one property and method values.
generateManyManyTags()  : mixed
Generate the $many_many method values.
generateOwnerTags()  : mixed
Generate the Owner-properties for extensions.
generateTags()  : void
Generates all ORM Tags
generateTagsForDataLists()  : mixed
getAnnotationClassName()  : string
Check if we need to use the short name for a class
getClassConfig()  : mixed
getOwnerClasses()  : array<string|int, string>|Generator
Get all owner classes of the given extension class
pushMethodTag()  : mixed
pushMixinTag()  : mixed
pushPropertyTag()  : mixed
pushTagWithExistingComment()  : Tag
resolveDotNotation()  : mixed

Properties

$existingTags

The existing tags of the class we are working with

protected array<string|int, Tag> $existingTags = []

$propertyTypes

protected static array<string|int, mixed> $propertyTypes = ['Owner', 'DB', 'HasOne', 'BelongsTo', 'HasMany', 'ManyMany', 'BelongsManyMany', 'Extensions']

Available properties to generate docblocks for.

$tags

List all the generated tags form the various generateSomeORMProperies methods

protected array<string|int, Tag> $tags = []
Tags
see

$this->getSupportedTagTypes();

Methods

__construct()

DocBlockTagGenerator constructor.

public __construct(string $className,  $existingTags) : mixed
Parameters
$className : string
$existingTags :
Tags
throws
ReflectionException

getExistingTagCommentByTagString()

public getExistingTagCommentByTagString(string $tagString) : string
Parameters
$tagString : string
Return values
string

getExistingTags()

public getExistingTags() : array<string|int, Tag>
Return values
array<string|int, Tag>

getSupportedTagTypes()

List of supported tags.

public getSupportedTagTypes() : array<string|int, mixed>

Each tag type can hold many tags, so we keep them grouped. Also used to reset the tag list after each run

Return values
array<string|int, mixed>

getTagNameForDBField()

public getTagNameForDBField(string $dbFieldType) : string
Parameters
$dbFieldType : string
Return values
string

getTags()

public getTags() : array<string|int, Tag>
Return values
array<string|int, Tag>

generateBelongsManyManyTags()

Generate the $belongs_many_many method values.

protected generateBelongsManyManyTags() : mixed

generateBelongsToTags()

Generate the $belongs_to property values.

protected generateBelongsToTags() : mixed

generateDBTags()

Generate the $db property values.

protected generateDBTags() : mixed

generateExtensionsTags()

Generate the mixins for DataExtensions.

protected generateExtensionsTags() : mixed

generateHasManyTags()

Generate the $has_many method values.

protected generateHasManyTags() : mixed

generateHasOneTags()

Generate the $has_one property and method values.

protected generateHasOneTags() : mixed

generateManyManyTags()

Generate the $many_many method values.

protected generateManyManyTags() : mixed

generateOwnerTags()

Generate the Owner-properties for extensions.

protected generateOwnerTags() : mixed
Tags
throws
ReflectionException

generateTags()

Generates all ORM Tags

protected generateTags() : void

generateTagsForDataLists()

protected generateTagsForDataLists(array<string|int, mixed> $fields[, string $listType = DataList::class ]) : mixed
Parameters
$fields : array<string|int, mixed>
$listType : string = DataList::class

getAnnotationClassName()

Check if we need to use the short name for a class

protected getAnnotationClassName(string $class) : string
Parameters
$class : string
Return values
string

getOwnerClasses()

Get all owner classes of the given extension class

protected getOwnerClasses(string $extensionClass) : array<string|int, string>|Generator
Parameters
$extensionClass : string

Class name of the extension

Return values
array<string|int, string>|Generator

List of all direct owners of this extension

pushMethodTag()

protected pushMethodTag(string $methodName, string $tagString) : mixed
Parameters
$methodName : string
$tagString : string

pushPropertyTag()

protected pushPropertyTag(string $tagString) : mixed
Parameters
$tagString : string

pushTagWithExistingComment()

protected pushTagWithExistingComment( $type,  $tagString) : Tag
Parameters
$type :
$tagString :
Return values
Tag

resolveDotNotation()

protected resolveDotNotation( $dataObjectName) : mixed
Parameters
$dataObjectName :

        
On this page

Search results