Index Documentation

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.

fromGetWarnings()

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.


        
On this page

Search results