开发者

DDBB structure so I can Manage playlists - Current, previous, next

For now i have:

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

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

i am wondering, will that be enough for me to let user add/remove items from playlist, and load previous and next item from playlist?

or i sh开发者_Go百科ould change my plan? (i have 50% PHP done, still no problem but i kind of have this feeling..)

Thanks in advance :P

I've done the playlist insert/edit/delete, now i'm upt to:

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'){

        }

    }




}


I suppose you have a class playlist where you did the insert/edit/delete. Then, why writing the get_what method inside the class playlist_item. Would it be a better fit to put it on your class playlist? (Since, I also suppose, your intention is that the get_what method returns an playlist_item object instance).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜