public function setSong($data) { $S = new playlistSong(); $S->setSong($data); $this->duration += $S->getDuration(); $this->songs[$data['id']] = $S; }