Skip to content

Kirby 5.0.4

$query->fetch()

Sets the object class, which should be fetched; set this to 'array' to get a simple array instead of an object; pass a function that receives the $data and the $key to generate arbitrary data structures

$query->fetch(Closure|callable|string $fetch): Kirby\Database\Query

Parameters

Name Type Default
$fetchrequired Closureorcallableorstring no default value

Return type

Kirby\Database\Query

This method modifies the existing $query object it is applied to and returns it again.

Parent class

Kirby\Database\Query