Ejemplo n.º 1
0
 public function logSearch($searchTerm, $searchType)
 {
     $userId = UsersController::getUserIdByHash();
     $userId = $userId != null ? $userId : 0;
     //if no user is returned, the request will be logged as if the user_id = 0 was making the request.
     DB::insert('INSERT INTO ns_searches (user_id, search_term, type) VALUES (?, ?, ?)', [$userId, $searchTerm, $searchType]);
 }
Ejemplo n.º 2
0
 public function deletePlaylist($playlistId)
 {
     $userId = UsersController::getUserIdByHash();
     DB::delete('DELETE FROM ns_playlists WHERE (user_id = ? AND playlist_id = ?)', [$userId, $playlistId]);
     return DB::delete('DELETE FROM ' . T_PLAYLIST_TRACKS . ' WHERE playlist_id = ?', [$playlistId]);
 }
Ejemplo n.º 3
0
 public function isExisting($releaseId)
 {
     $userId = UsersController::getUserIdByHash();
     return DB::select('SELECT id FROM ' . T_SAVED_ALBUMS . ' WHERE user_id = ? AND id = ?', [$userId, $releaseId]);
 }