本文整理匯總了PHP中PMA_RecentFavoriteTable::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_RecentFavoriteTable::add方法的具體用法?PHP PMA_RecentFavoriteTable::add怎麽用?PHP PMA_RecentFavoriteTable::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PMA_RecentFavoriteTable
的用法示例。
在下文中一共展示了PMA_RecentFavoriteTable::add方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: PMA_synchronizeFavoriteTables
/**
* Synchronize favorite tables
*
* @param PMA_RecentFavoriteTable $fav_instance Instance of this class
* @param string $user The user hash
* @param array $favorite_tables Existing favorites
*
* @return void
*/
function PMA_synchronizeFavoriteTables($fav_instance, $user, $favorite_tables)
{
$fav_instance_tables = $fav_instance->getTables();
if (empty($fav_instance_tables) && isset($favorite_tables[$user])) {
foreach ($favorite_tables[$user] as $key => $value) {
$fav_instance->add($value['db'], $value['table']);
}
}
$favorite_tables[$user] = $fav_instance->getTables();
$ajax_response = PMA_Response::getInstance();
$ajax_response->addJSON('favorite_tables', json_encode($favorite_tables));
$ajax_response->addJSON('list', $fav_instance->getHtmlList());
$server_id = $GLOBALS['server'];
// Set flag when localStorage and pmadb(if present) are in sync.
$_SESSION['tmpval']['favorites_synced'][$server_id] = true;
}