PHP Класс PMA\libraries\Bookmark

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
applyVariables ( array $variables ) : string Replace the placeholders in the bookmark query with variables
createBookmark ( array $bkm_fields, boolean $all_users = false ) : Bookmark | false Creates a Bookmark object from the parameters
delete ( ) : boolean Deletes a bookmark
get ( string $db, mixed $id, string $id_field = 'id', boolean $action_bookmark_all = false, boolean $exact_user_match = false ) : Bookmark Retrieve a specific bookmark
getDatabase ( ) : string Returns the database of the bookmark
getId ( ) : integer Returns the ID of the bookmark
getLabel ( ) : string Returns the label of the bookmark
getList ( string | boolean $db = false ) : Bookmark[] Gets the list of bookmarks defined for the current database
getParams ( ) : array Defines the bookmark parameters for the current user
getQuery ( ) : string Returns the query
getUser ( ) : string Returns the user whom the bookmark belongs to
getVariableCount ( ) : number Returns the number of variables in a bookmark
save ( ) : boolean Adds a bookmark

Описание методов

applyVariables() публичный Метод

Replace the placeholders in the bookmark query with variables
public applyVariables ( array $variables ) : string
$variables array array of variables
Результат string query with variables applied

createBookmark() публичный статический Метод

Creates a Bookmark object from the parameters
public static createBookmark ( array $bkm_fields, boolean $all_users = false ) : Bookmark | false
$bkm_fields array the properties of the bookmark to add; here, $bkm_fields['bkm_sql_query'] is urlencoded
$all_users boolean whether to make the bookmark available for all users
Результат Bookmark | false

delete() публичный Метод

Deletes a bookmark
public delete ( ) : boolean
Результат boolean true if successful

get() публичный статический Метод

Retrieve a specific bookmark
public static get ( string $db, mixed $id, string $id_field = 'id', boolean $action_bookmark_all = false, boolean $exact_user_match = false ) : Bookmark
$db string the current database name
$id mixed an identifier of the bookmark to get
$id_field string which field to look up the identifier
$action_bookmark_all boolean true: get all bookmarks regardless of the owning user
$exact_user_match boolean whether to ignore bookmarks with no user
Результат Bookmark the bookmark

getDatabase() публичный Метод

Returns the database of the bookmark
public getDatabase ( ) : string
Результат string

getId() публичный Метод

Returns the ID of the bookmark
public getId ( ) : integer
Результат integer

getLabel() публичный Метод

Returns the label of the bookmark
public getLabel ( ) : string
Результат string

getList() публичный статический Метод

Gets the list of bookmarks defined for the current database
public static getList ( string | boolean $db = false ) : Bookmark[]
$db string | boolean the current database name or false
Результат Bookmark[] the bookmarks list

getParams() публичный статический Метод

Defines the bookmark parameters for the current user
public static getParams ( ) : array
Результат array the bookmark parameters for the current user

getQuery() публичный Метод

Returns the query
public getQuery ( ) : string
Результат string

getUser() публичный Метод

Returns the user whom the bookmark belongs to
public getUser ( ) : string
Результат string

getVariableCount() публичный Метод

Returns the number of variables in a bookmark
public getVariableCount ( ) : number
Результат number number of variables

save() публичный Метод

Adds a bookmark
public save ( ) : boolean
Результат boolean whether the INSERT succeeds or not