You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49ed446
Browse filesBrowse the repository at this point in the historyBrowse files
Entity objects are provided per domain layer and usually follow a [POPO](https://stackoverflow.com/questions/41188002/what-does-the-term-plain-old-php-object-popo-exactly-mean)
4
+
design.
5
+
6
+
To simplify the creation of entities the base domain layer provides common fields and features in the form of PHP
7
+
traits. Entity fields can be compared to a read-operation, whereas entity features represent a write-operation.
8
+
9
+
They are defined in a dedicated namespace for discovery, respectively `Msgphp\Domain\Entiy\Field\` and
10
+
`MsgPhp\Domain\Entity\Features\`.
11
+
12
+
## Common entity fields
13
+
14
+
### `CreatedAtField`
15
+
16
+
A datetime value representing the entity was initially created at.
17
+
18
+
-`getCreatedAt(): \DateTimeInterface`
19
+
- Required to be set initially
20
+
21
+
### `EnabledField`
22
+
23
+
A boolean value representing the entity should be considered enabled yes or no.
24
+
25
+
-`isEnabled(): bool`
26
+
-`false` by default
27
+
28
+
### `LastUpdatedAtField`
29
+
30
+
A datetime value representing the entity was last updated at.
31
+
32
+
-`getLastUpdatedAt(): \DateTimeInterface`
33
+
- Required to be set initially
34
+
35
+
## Common entity features
36
+
37
+
### `CanBeConfirmed`
38
+
39
+
Provides ability to confirm an entity. When used an entity is considered initially unconfirmed.
40
+
41
+
-`getConfirmationToken(): ?string`
42
+
- Required to be set initially
43
+
-`getConfirmedAt(): ?\DateTimeInterface`
44
+
-`isConfirmed(): bool`
45
+
-`confirm(): void`
46
+
-`confirmationToken` is unset
47
+
-`confirmatedAt` is set to current datetime
48
+
49
+
### `CanBeEnabled`
50
+
51
+
Provides ability to toggle an entity availability state.
0 commit comments