2011-03-17 25 views
0

現在我有:DDBB結構,所以我可以管理播放列表 - 當前,上,下一個

Table playlist (id, name, id_user,many_items,last_item_used,...) 

table playlist_map (id, id_user, id_item,position...) 

我想知道,那將是對我來說足夠讓用戶添加/刪除播放列表中的項目,和負載播放列表中的上一個和下一個項目?

或者我應該改變我的計劃? (我有50%的PHP做了,仍然沒有問題,但我種有這種感覺..)提前

感謝:P

我已經做了播放列表插入/修改/刪除,現在我upt到:

class playlist_item{ 

    protected $id; 
    protected $id_item; 
    protected $nombre; 
    protected $url; 
    protected $id_playlist; 
    protected $position; 


    function __construct($id) { 



    } 

    function get_what($what){ 
     if($what == 'next'){ 

     }else if($what == 'prev'){ 

     }else if($what == 'last'){ 

     }else if($what == 'first'){ 

     }else if($what == 'current'){ 

     } 

    } 




} 
+0

通過編寫這個.... ehm ..順序在playlist_map,對嗎? – 2011-03-17 02:18:47

回答

1

我想你有一個類的播放列表,你插入/編輯/刪除。然後,爲什麼要在類playlist_item中寫入get_what方法。將它放在班級播放列表上會更合適嗎? (因爲,我也想,你的意圖是get_what方法返回一個playlist_item對象實例)。

+0

實際上我的目的是獲得播放列表中的位置和objet的id。已經解決了這個問題。但我不記得,如果我按照這個問題做了,我會檢查;) – 2011-08-26 10:14:03

+0

我也認爲這個答案應該是coment;它不是真的回答:) – 2011-08-27 16:25:10

相關問題