TagId
in package
Read onlyYes
FinalYes
Value object representing a Tag's unique identifier.
Immutable and self-validating. A value of 0 indicates an unsaved entity.
Tags
Table of Contents
Properties
- $value : int
Methods
- __toString() : string
- String representation for debugging.
- equals() : bool
- Check equality with another TagId.
- fromInt() : self
- Create from an existing database ID.
- isNew() : bool
- Check if this represents an unsaved entity.
- new() : self
- Create a new ID for an unsaved entity.
- toInt() : int
- Get the integer value.
- __construct() : mixed
Properties
$value
private
int
$value
Methods
__toString()
String representation for debugging.
public
__toString() : string
Return values
stringequals()
Check equality with another TagId.
public
equals(TagId $other) : bool
Parameters
- $other : TagId
-
The other TagId to compare
Return values
boolfromInt()
Create from an existing database ID.
public
static fromInt(int $id) : self
Parameters
- $id : int
-
The database ID (must be positive)
Tags
Return values
selfisNew()
Check if this represents an unsaved entity.
public
isNew() : bool
Return values
boolnew()
Create a new ID for an unsaved entity.
public
static new() : self
Return values
selftoInt()
Get the integer value.
public
toInt() : int
Return values
int__construct()
private
__construct(int $value) : mixed
Parameters
- $value : int
-
The tag ID value (0 for unsaved, positive for persisted)