Ejemplo n.º 1
0
 public static function setIsPlaylist($p_playlistItems, $p_type, $p_status)
 {
     foreach ($p_playlistItems as $item) {
         $file = self::RecallById($item->getDbFileId());
         $fileId = $file->_file->getDbId();
         if ($p_type == 'playlist') {
             // we have to check if the file is in another playlist before
             // we can update
             if (!is_null($fileId) && !in_array($fileId, Application_Model_Playlist::getAllPlaylistFiles())) {
                 $file->_file->setDbIsPlaylist($p_status)->save();
             }
         } elseif ($p_type == 'block') {
             if (!is_null($fileId) && !in_array($fileId, Application_Model_Block::getAllBlockFiles())) {
                 $file->_file->setDbIsPlaylist($p_status)->save();
             }
         }
     }
 }