/** * Create instance of a Playlist object. * * @param string $p_fname * Name of the playlist * @return Playlist */ public function create($p_fname = NULL) { $this->name = !empty($p_fname) ? $p_fname : date("H:i:s"); $this->mtime = new DateTime("now"); $pl = new CcPlaylist(); $pl->setDbName($this->name); $pl->setDbState("incomplete"); $pl->setDbMtime($this->mtime); $pl->save(); $this->id = $pl->getDbId(); $this->setState('ready'); return $this; }