Attribute Class

class Attribute

Represents an Entity Attribute

__construct(string $name, string $type)

Create a new Attribute instance

Parameters:
  • $name (string) – Attribute name

  • $type (string) – Attribute type

Returns:

An Attribute instance

Return type:

Attribute

addComment(string $comment)
Parameters:
  • $comment (string) – The comment

Returns:

An Attribute instance with the comment

Return type:

Attribute

addKey(Key ...$key)

Add key type(s) to the attribute

Parameters:
  • ...$key (Key) – Key type(s)

Returns:

An Attribute instance with the keys added

Return type:

Attribute

withKey(Key ...$key)

Set key type(s) to the attribute

Parameters:
  • ...$key (Key) – Key type(s)

Returns:

An Attribute instance with the keys

Return type:

Attribute