PHP Class PMA\libraries\RecentFavoriteTable

Show file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Public Methods

Method Description
add ( string $db, string $table ) : true | Message Add recently used or favorite tables.
getFromDb ( ) : array Returns recently used tables or favorite from phpMyAdmin database.
getHtml ( ) : string Return HTML.
getHtmlList ( ) : string Return HTML ul.
getHtmlSyncFavoriteTables ( ) : string Generate Html for sync Favorite tables anchor. (from localStorage to pmadb)
getHtmlUpdateRecentTables ( ) : string Generate Html to update recent tables.
getInstance ( string $type ) : RecentFavoriteTable Returns class instance.
getTables ( ) : array Returns the recent/favorite tables array
remove ( string $db, string $table ) : true | Message Remove favorite tables.
removeIfInvalid ( string $db, string $table ) : boolean | Message Removes recent/favorite tables that don't exist.
saveToDb ( ) : true | Message Save recent/favorite tables into phpMyAdmin database.
trim ( ) : boolean Trim recent.favorite table according to the NumRecentTables/NumFavoriteTables configuration.

Private Methods

Method Description
__construct ( string $type ) Creates a new instance of RecentFavoriteTable
_getPmaTable ( ) : string Reutrn the name of the configuration storage table

Method Details

add() public method

Add recently used or favorite tables.
public add ( string $db, string $table ) : true | Message
$db string database name where the table is located
$table string table name
return true | Message True if success, Message if not

getFromDb() public method

Returns recently used tables or favorite from phpMyAdmin database.
public getFromDb ( ) : array
return array

getHtml() public method

Return HTML.
public getHtml ( ) : string
return string

getHtmlList() public method

Return HTML ul.
public getHtmlList ( ) : string
return string

getHtmlSyncFavoriteTables() public method

Generate Html for sync Favorite tables anchor. (from localStorage to pmadb)

getHtmlUpdateRecentTables() public static method

Generate Html to update recent tables.
public static getHtmlUpdateRecentTables ( ) : string
return string html

getInstance() public static method

Returns class instance.
public static getInstance ( string $type ) : RecentFavoriteTable
$type string the table type
return RecentFavoriteTable

getTables() public method

Returns the recent/favorite tables array
public getTables ( ) : array
return array

remove() public method

Remove favorite tables.
public remove ( string $db, string $table ) : true | Message
$db string database name where the table is located
$table string table name
return true | Message True if success, Message if not

removeIfInvalid() public method

Removes recent/favorite tables that don't exist.
public removeIfInvalid ( string $db, string $table ) : boolean | Message
$db string database
$table string table
return boolean | Message True if invalid and removed, False if not invalid, Message if error while removing

saveToDb() public method

Save recent/favorite tables into phpMyAdmin database.
public saveToDb ( ) : true | Message
return true | Message

trim() public method

Trim recent.favorite table according to the NumRecentTables/NumFavoriteTables configuration.
public trim ( ) : boolean
return boolean True if trimming occurred