final class ConnectionName

Constants

READ

WRITE

Methods

__construct(string $requested, string $base, string|null $role = null)

Create a new parsed connection name instance.

static ConnectionName
parse(string $name)

Parse a database connection name.

static string|null
withoutWriteType(string|null $name)

Remove the write role when comparing model identities.

bool
isRead()

Determine if the parsed name requests the read side.

bool
isWrite()

Determine if the parsed name requests the write side.

Details

at line 18
__construct(string $requested, string $base, string|null $role = null)

Create a new parsed connection name instance.

Parameters

string $requested
string $base
string|null $role

at line 28
static ConnectionName parse(string $name)

Parse a database connection name.

Parameters

string $name

Return Value

ConnectionName

at line 54
static string|null withoutWriteType(string|null $name)

Remove the write role when comparing model identities.

Read aliases remain distinct because they can select another endpoint.

Parameters

string|null $name

Return Value

string|null

at line 66
bool isRead()

Determine if the parsed name requests the read side.

Return Value

bool

at line 74
bool isWrite()

Determine if the parsed name requests the write side.

Return Value

bool