Documentation

PdbReturnInterface

Configuration for query return types.

Table of Contents

Methods

buildClass()  : array<string|int, object>|object|null
Format a result into class instance.
format()  : string|int|null|array<string|int, mixed>
Format the result set.
getCacheKey()  : string
The uniqueness for this return config.
getCacheTtl()  : int
Determine an appropriate TTL between the return config and pdb config.
hasFormatting()  : bool
Should this return config perform formatting?

Methods

buildClass()

Format a result into class instance.

public buildClass(array<string|int, mixed> $result) : array<string|int, object>|object|null
Parameters
$result : array<string|int, mixed>
Return values
array<string|int, object>|object|null

format()

Format the result set.

public format(PDOStatement $rs) : string|int|null|array<string|int, mixed>
Parameters
$rs : PDOStatement
Return values
string|int|null|array<string|int, mixed>

getCacheKey()

The uniqueness for this return config.

public getCacheKey() : string

A cache key is constructed from a few parts:

  • the connection 'identity', typically a sha of the DSN
  • the query string + parameters
  • this return type

This method is only called if the the cache is enabled via the getCacheTtl() method.

Return values
string

getCacheTtl()

Determine an appropriate TTL between the return config and pdb config.

public getCacheTtl() : int

Return zero to disable caching.

Return values
int

hasFormatting()

Should this return config perform formatting?

public hasFormatting() : bool

If this is false the result (from pdb::query and pdb::execute) will be a raw PDOStatement.

Return values
bool
On this page

Search results