Documentation

TextId

Read onlyYes
FinalYes

Value object representing a Text's unique identifier.

Immutable and self-validating. A value of 0 indicates an unsaved entity.

Tags
since
3.0.0

Table of Contents

Properties

$value  : int

Methods

__toString()  : string
String representation for debugging.
equals()  : bool
Check equality with another TextId.
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

Methods

__toString()

String representation for debugging.

public __toString() : string
Return values
string

equals()

Check equality with another TextId.

public equals(TextId $other) : bool
Parameters
$other : TextId

The other TextId to compare

Return values
bool

fromInt()

Create from an existing database ID.

public static fromInt(int $id) : self
Parameters
$id : int

The database ID (must be positive)

Tags
throws
InvalidArgumentException

If ID is not positive

Return values
self

isNew()

Check if this represents an unsaved entity.

public isNew() : bool
Return values
bool

new()

Create a new ID for an unsaved entity.

public static new() : self
Return values
self

toInt()

Get the integer value.

public toInt() : int
Return values
int

__construct()

private __construct(int $value) : mixed
Parameters
$value : int

The text ID value (0 for unsaved, positive for persisted)


        
On this page

Search results