Ampache
[ class tree: Ampache ] [ index: Ampache ] [ all elements ]

Class: Playlist

Source Location: /lib/class/playlist.class.php

Class Overview

database_object
   |
   --Playlist

Playlist Class


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 26]
Playlist Class

This class handles playlists in ampache. it references the playlist* tables




[ Top ]


Class Variables

$date =

[line 34]



Tags:

access:  public

Type:   mixed


[ Top ]

$genre =

[line 33]



Tags:

access:  public

Type:   mixed


[ Top ]

$id =

[line 29]



Tags:

access:  public

Type:   mixed


[ Top ]

$items = array()

[line 37]



Tags:

access:  public

Type:   mixed


[ Top ]

$name =

[line 30]



Tags:

access:  public

Type:   mixed


[ Top ]

$type =

[line 32]



Tags:

access:  public

Type:   mixed


[ Top ]

$user =

[line 31]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method build_cache [line 58]

static void build_cache( $ids)

build_cache

This is what builds the cache from the objects




Tags:

access:  public


Parameters:

   $ids  

[ Top ]

static method create [line 409]

static void create( $name, $type)

create

This function creates an empty playlist, gives it a name and type Assumes $GLOBALS['user']->id as the user




Tags:

access:  public


Parameters:

   $name  
   $type  

[ Top ]

static method get_users [line 252]

static void get_users( $user_id)

get_users

This returns the specified users playlists as an array of playlist ids




Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

constructor __construct [line 44]

Playlist __construct( $id)

Constructor

This takes a playlist_id as an optional argument and gathers the information if not playlist_id is passed returns false (or if it isn't found




Tags:

access:  public


Parameters:

   $id  

[ Top ]

method add_dyn_song [line 382]

void add_dyn_song( )

add_dyn_song

This adds a dynamic song to a specified playlist this is just called as the song its self is stored in the session to keep it away from evil users




[ Top ]

method add_songs [line 347]

void add_songs( [ $song_ids = array()])

add_songs

This takes an array of song_ids and then adds it to the playlist if you want to add a dyn_song you need to use the one shot function add_dyn_song




Tags:

access:  public


Parameters:

   $song_ids  

[ Top ]

method delete [line 489]

void delete( )

delete

This deletes the current playlist and all assoicated data




Tags:

access:  public


[ Top ]

method delete_track [line 473]

void delete_track( $id)

delete_track

this deletes a single track, you specify the playlist_data.id here




Tags:

access:  public


Parameters:

   $id  

[ Top ]

method format [line 78]

void format( )

format

This takes the current playlist object and gussies it up a little bit so it is presentable to the users




Tags:

access:  public


[ Top ]

method get_dyn_songs [line 214]

void get_dyn_songs( $dyn_string)

get_dyn_songs

This returns an array of song_ids for a single dynamic playlist entry




Parameters:

   $dyn_string  

[ Top ]

method get_items [line 136]

void get_items( )

get_items

This returns an array of playlist songs that are in this playlist. Because the same song can be on the same playlist twice they are key'd by the uid from playlist_data




Tags:

access:  public


[ Top ]

method get_random_items [line 160]

void get_random_items( [ $limit = ''])

get_random_items

This is the same as before but we randomize the buggers!




Tags:

access:  public


Parameters:

   $limit  

[ Top ]

method get_songs [line 188]

void get_songs( )

get_songs

This is called by the batch script, because we can't pass in Dynamic objects they pulled once and then their target song.id is pushed into the array




[ Top ]

method get_song_count [line 236]

void get_song_count( )

get_song_count

This simply returns a int of how many song elements exist in this playlist For now let's consider a dyn_song a single entry




Tags:

access:  public


[ Top ]

method get_track [line 117]

void get_track( $track_id)

get_track

Returns the single item on the playlist and all of it's information, restrict it to this Playlist




Tags:

access:  public


Parameters:

   $track_id  

[ Top ]

method has_access [line 96]

void has_access( )

has_access

This function returns true or false if the current user has access to this playlist




Tags:

access:  public


[ Top ]

method normalize_tracks [line 442]

void normalize_tracks( )

normalize_tracks

this takes the crazy out of order tracks and numbers them in a liner fashion, not allowing for the same track # twice, this is an optional funcition




Tags:

access:  public


[ Top ]

method set_items [line 430]

void set_items( )

set_items

This calles the get_items function and sets it to $this->items which is an array in this object




[ Top ]

method update [line 272]

void update( $data)

update

This function takes a key'd array of data and runs updates




Tags:

access:  public


Parameters:

   $data  

[ Top ]

method update_track_number [line 330]

void update_track_number( $track_id, $track)

update_track_number

This takes a playlist_data.id and a track (int) and updates the track value




Tags:

access:  public


Parameters:

   $track_id  
   $track  

[ Top ]


Documentation generated on Thu, 12 Feb 2009 08:00:05 +0900 by phpDocumentor 1.4.2