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, MariaDbWarning>
- Creates an array of warning objects from a mysqli_warning instance.
- fromLastErrors() : array<string|int, MariaDbWarning>
- 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, MariaDbWarning>
Parameters
- $warnings : mysqli_warning|false
-
Warning object.
Return values
array<string|int, MariaDbWarning> —Array of warning objects.
fromLastErrors()
Creates an array of warning objects from the output of $last_errors.
public
static fromLastErrors(array<int, array{errno: int, sqlstate: string, error: string}> $errors) : array<string|int, MariaDbWarning>
Parameters
- $errors : array<int, array{errno: int, sqlstate: string, error: string}>
-
Array of warning arrays.
Return values
array<string|int, MariaDbWarning> —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.