Наследование: extends AbstractEntity
Пример #1
0
 /**
  * Clear cache for all temlates assigned to playlist.
  *
  * @param Playlist $playlist
  */
 public function clearPlaylistTemplates($playlist)
 {
     foreach ($playlist->getThemes() as $theme) {
         if (is_array($theme)) {
             foreach ($theme as $file) {
                 \TemplateCacheHandler_DB::clean($file);
             }
         }
     }
 }
 public function setId($id)
 {
     $this->__load();
     return parent::setId($id);
 }
Пример #3
0
 public function saveDataAction()
 {
     $playlistId = $this->_request->getParam('id', null);
     $playlist = null;
     $playlistName = $this->_request->getParam('name', '');
     // TODO make a service
     if (is_numeric($playlistId)) {
         $playlist = $this->playlistRepository->find($playlistId);
         if (!is_null($playlist) && trim($playlistName) != '') {
             $playlist->setName($playlistName);
         }
     } else {
         $playlist = new Playlist();
         $playlist->setName(trim($playlistName) != '' ? $playlistName : getGS('Playlist') . strftime('%F'));
     }
     $playlist = $this->playlistRepository->save($playlist, $this->_request->getParam('articles'));
     if (!$playlist instanceof \Exception) {
         $this->_helper->service->getService('dispatcher')->notify('playlist.save', new GenericEvent($this, array('id' => $playlist->getId())));
         $this->view->playlistId = $playlist->getId();
         $this->view->playlistName = $playlist->getName();
     } else {
         $this->view->error = $playlist->getFile() . ":" . $playlist->getLine() . " " . $playlist->getMessage();
     }
 }