PHP Class PMA\libraries\Bookmark

Afficher le fichier Open project: phpmyadmin/phpmyadmin Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

applyVariables() public méthode

Replace the placeholders in the bookmark query with variables
public applyVariables ( array $variables ) : string
$variables array array of variables
Résultat string query with variables applied

createBookmark() public static méthode

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
Résultat Bookmark | false

delete() public méthode

Deletes a bookmark
public delete ( ) : boolean
Résultat boolean true if successful

get() public static méthode

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
Résultat Bookmark the bookmark

getDatabase() public méthode

Returns the database of the bookmark
public getDatabase ( ) : string
Résultat string

getId() public méthode

Returns the ID of the bookmark
public getId ( ) : integer
Résultat integer

getLabel() public méthode

Returns the label of the bookmark
public getLabel ( ) : string
Résultat string

getList() public static méthode

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
Résultat Bookmark[] the bookmarks list

getParams() public static méthode

Defines the bookmark parameters for the current user
public static getParams ( ) : array
Résultat array the bookmark parameters for the current user

getQuery() public méthode

Returns the query
public getQuery ( ) : string
Résultat string

getUser() public méthode

Returns the user whom the bookmark belongs to
public getUser ( ) : string
Résultat string

getVariableCount() public méthode

Returns the number of variables in a bookmark
public getVariableCount ( ) : number
Résultat number number of variables

save() public méthode

Adds a bookmark
public save ( ) : boolean
Résultat boolean whether the INSERT succeeds or not