entity_interface extends JsonSerializable
Interface Entity.
The base contract for all domain entities. Ensures basic identification and serialization capabilities.
Table of Contents
Methods
- get_id() : null|int
- Get the entity unique identifier.
- to_array() : array<string, mixed>
- Convert the entity state to a plain associative array.
Methods
get_id()
Get the entity unique identifier.
public
get_id() : null|int
Returns null if the entity has not been persisted yet.
Return values
null|intto_array()
Convert the entity state to a plain associative array.
public
to_array() : array<string, mixed>
Useful for DTO conversion, logging, or debugging.