Example #1
0
 /**
  * Delete all files from playlist
  * @param int $p_playlistId
  */
 public function deleteAllFilesFromPlaylist()
 {
     // get only the files from the playlist
     // we are about to clear out
     $itemsToDelete = CcPlaylistcontentsQuery::create()->filterByDbPlaylistId($this->id)->filterByDbFileId(null, Criteria::NOT_EQUAL)->find();
     CcPlaylistcontentsQuery::create()->findByDbPlaylistId($this->id)->delete();
     // update is_playlist flag in cc_files
     Application_Model_StoredFile::setIsPlaylist($itemsToDelete, 'playlist', false);
     $this->pl->setDbMtime(new DateTime("now", new DateTimeZone("UTC")));
     $this->pl->save($this->con);
     $this->con->commit();
 }