class Bookmark (View source)

Handles bookmarking SQL queries

Methods

__construct(DatabaseInterface $dbi, BookmarkFeature $bookmarkFeature, string $database, string $currentUser, string $label, string $query, int $id = 0)

No description

int
getId()

Returns the ID of the bookmark

string
getDatabase()

Returns the database of the bookmark

string
getUser()

Returns the user whom the bookmark belongs to

string
getLabel()

Returns the label of the bookmark

string
getQuery()

Returns the query

bool
save()

Adds a bookmark

bool
delete()

Deletes a bookmark

int
getVariableCount()

Returns the number of variables in a bookmark

string
applyVariables(array $variables)

Replace the placeholders in the bookmark query with variables

Details

__construct(DatabaseInterface $dbi, BookmarkFeature $bookmarkFeature, string $database, string $currentUser, string $label, string $query, int $id = 0)

No description

Parameters

DatabaseInterface $dbi
BookmarkFeature $bookmarkFeature
string $database

Database the bookmark belongs to

string $currentUser

The user to whom the bookmark belongs, empty for public bookmarks

string $label

Label of the bookmark

string $query

SQL query that is bookmarked

int $id

ID of the bookmark

int getId()

Returns the ID of the bookmark

Return Value

int

string getDatabase()

Returns the database of the bookmark

Return Value

string

string getUser()

Returns the user whom the bookmark belongs to

Return Value

string

string getLabel()

Returns the label of the bookmark

Return Value

string

string getQuery()

Returns the query

Return Value

string

bool save()

Adds a bookmark

Return Value

bool

bool delete()

Deletes a bookmark

Return Value

bool

int getVariableCount()

Returns the number of variables in a bookmark

Return Value

int

number of variables

string applyVariables(array $variables)

Replace the placeholders in the bookmark query with variables

Parameters

array $variables

Return Value

string

query with variables applied