class QueryMetadata (View source)

This class provides metadata for a database query, including the query string, arguments, columns, and rows.

Methods:

  • getString(): string: Retrieves the query string.
  • setString(string $string): self: Sets the query string.
  • getArguments(): ?array: Retrieves the query arguments.
  • setArguments(?array $arguments): self: Sets the query arguments.
  • getColumns(): int: Retrieves the number of columns.
  • setColumns(int $columns): self: Sets the number of columns.
  • getRows(): RowsMetadata: Retrieves the rows metadata.

Fields:

  • $string: The query string.
  • $arguments: The query arguments.
  • $columns: The number of columns in the query result.
  • $rows: The metadata for the rows in the query result.

Properties

string $string

Represents the metadata of a database query, including the query string, arguments, column count, and row metadata.

array|null $arguments

Holds the arguments for the database query.

int $columns

The number of columns returned by the database query.

RowsMetadata $rows

Holds the metadata for the rows returned by the database query.

Methods

__construct()

QueryMetadata constructor.

string
getString()

Gets the query string.

setString(string $string)

Sets the query string.

array|null
getArguments()

Gets the query arguments.

setArguments(array|null $arguments)

Sets the query arguments.

int
getColumns()

Gets the number of columns.

setColumns(int $columns)

Sets the number of columns.

getRows()

Gets the rows metadata.

Details

__construct()

QueryMetadata constructor.

Initializes a new instance of the RowsMetadata class.

string getString()

Gets the query string.

Return Value

string

The query string.

QueryMetadata setString(string $string)

Sets the query string.

Parameters

string $string

The query string.

Return Value

QueryMetadata

Returns the current instance for method chaining.

array|null getArguments()

Gets the query arguments.

Return Value

array|null

The query arguments, or null if none are set.

QueryMetadata setArguments(array|null $arguments)

Sets the query arguments.

Parameters

array|null $arguments

The query arguments.

Return Value

QueryMetadata

Returns the current instance for method chaining.

int getColumns()

Gets the number of columns.

Return Value

int

The number of columns.

QueryMetadata setColumns(int $columns)

Sets the number of columns.

Parameters

int $columns

The number of columns.

Return Value

QueryMetadata

Returns the current instance for method chaining.

RowsMetadata getRows()

Gets the rows metadata.

Return Value

RowsMetadata

The row's metadata.