Similar to {@link \Elgg\Database::getData()} but returns only the first row
matched. If a callback function $callback is specified, the row will be passed
as the only argument to $callback.
public getDataRow ( string $query, callable $callback = null, array $params = [] ) : mixed | ||
$query | string | The query to execute. |
$callback | callable | A callback function to apply to the row |
$params | array | Query params. E.g. [1, 'steve'] or [':id' => 1, ':name' => 'steve'] |
return | mixed | A single database result object or the result of the callback function. |