MariaDBWarning
in package
implements
Stringable
Represents a MariaDB/MySQL warning.
Table of Contents
Interfaces
- Stringable
Methods
- __construct() : MariaDBWarning
- Creates a new MariaDBWarning object.
- __toString() : string
- fromGetWarnings() : array<string|int, mixed>
- Creates an array of warning objects from a mysqli_warning instance.
- fromLastErrors() : array<string|int, mixed>
- Creates an array of warning objects from the output of $last_errors.
- getCode() : int
- Gets the warning error code.
- getMessage() : string
- Gets the warning message string.
- getSQLState() : string
- Gets the warning SQL State.
Methods
__construct()
Creates a new MariaDBWarning object.
public
__construct(string $message, string $sqlState, int $code) : MariaDBWarning
Parameters
- $message : string
-
Warning message string.
- $sqlState : string
-
SQL State of the warning.
- $code : int
-
Error code of the warning.
Return values
MariaDBWarning —A new warning instance.
__toString()
public
__toString() : string
Return values
stringfromGetWarnings()
Creates an array of warning objects from a mysqli_warning instance.
public
static fromGetWarnings(mysqli_warning|false $warnings) : array<string|int, mixed>
Parameters
- $warnings : mysqli_warning|false
-
Warning object.
Return values
array<string|int, mixed> —Array of warning objects.
fromLastErrors()
Creates an array of warning objects from the output of $last_errors.
public
static fromLastErrors(array<string|int, mixed> $errors) : array<string|int, mixed>
Parameters
- $errors : array<string|int, mixed>
-
Array of warning arrays.
Return values
array<string|int, mixed> —Array of warnings objects.
getCode()
Gets the warning error code.
public
getCode() : int
Return values
int —Warning error code.
getMessage()
Gets the warning message string.
public
getMessage() : string
Return values
string —Warning message string.
getSQLState()
Gets the warning SQL State.
public
getSQLState() : string
Return values
string —SQL State.