final class BookmarkRepository (View source)

Handles bookmarking SQL queries

Methods

__construct(DatabaseInterface $dbi, Relation $relation)

No description

Bookmark|false
createBookmark(string $sqlQuery, string $label, string $user, string $database, bool $shared = false)

Creates a Bookmark object from the parameters

array
getList(string $user, string|false $db = false)

Gets the list of bookmarks defined for the current database

Bookmark|null
get(string|null $user, int $id)

Retrieve a specific bookmark

Bookmark|null
getByLabel(string $user, DatabaseName $db, string $label)

Retrieve a specific bookmark by its label

Details

__construct(DatabaseInterface $dbi, Relation $relation)

No description

Parameters

DatabaseInterface $dbi
Relation $relation

Bookmark|false createBookmark(string $sqlQuery, string $label, string $user, string $database, bool $shared = false)

Creates a Bookmark object from the parameters

Parameters

string $sqlQuery
string $label
string $user
string $database
bool $shared

whether to make the bookmark available for all users

Return Value

Bookmark|false

array getList(string $user, string|false $db = false)

Gets the list of bookmarks defined for the current database

Parameters

string $user

Current user

string|false $db

the current database name or false

Return Value

array

the bookmarks list

Bookmark|null get(string|null $user, int $id)

Retrieve a specific bookmark

Parameters

string|null $user
int $id

Return Value

Bookmark|null

Bookmark|null getByLabel(string $user, DatabaseName $db, string $label)

Retrieve a specific bookmark by its label

Parameters

string $user
DatabaseName $db
string $label

Return Value

Bookmark|null