public function setSong($data) { $S = new playlistSong(); $S->setSong($data); $this->duration += $S->getDuration(); $this->songs[$data['id']] = $S; }
public function sortSong($post) { $id = str_replace('song_', '', $post['song_id']); $newPosition = $post['position']; $temp_ids = explode('_', $post['parent_id']); $pb_id = $temp_ids[1]; $pl_id = $temp_ids[2]; $song = new playlistSong(); $song->getSongByID($id); $song->getPosition($pl_id); if ($pb_id == 'uebrige') { $song->eraseFromPlaylist(); } else { $block = new playlist_bloecke(); $block->getBlockByID($pb_id); $block->getSongs(); $block->resortSongs($newPosition, $id); } $this->getAndReturnPlayZeiten($pl_id); }
private function savePlayedStatus($ps_id, $status) { $song = new playlistSong(); $song->getSongByPS_ID($ps_id); $song->setPlayedStatus($status); echo json_encode($song->getPlayedStatus()); }