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
 /**
  * Synchronize favorite tables
  *
  *
  * @param RecentFavoriteTable $fav_instance    Instance of this class
  * @param string              $user            The user hash
  * @param array               $favorite_tables Existing favorites
  *
  * @return void
  */
 protected function 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();
     $this->response->addJSON(array('favorite_tables' => json_encode($favorite_tables), '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;
 }