private function renderKalturaFeed($state, $entry = null, $e = null, $moreItems = false)
 {
     switch ($state) {
         case self::STATE_HEADER:
             header("content-type: text/xml; charset=utf-8");
             echo kSyndicationFeedManager::getMrssHeader($this->syndicationFeed->name, $this->syndicationFeed->feedLandingPage, $this->syndicationFeed->feedDescription, $this->syndicationFeedDB);
             break;
         case self::STATE_BODY:
             //syndication parameters to pass to XSLT
             $xslParams = array();
             $xslParams[XsltParameterName::KALTURA_HAS_NEXT_ITEM] = $moreItems;
             $xslParams[XsltParameterName::KALTURA_SYNDICATION_FEED_FLAVOR_PARAM_ID] = $this->syndicationFeedDB->getFlavorParamId();
             echo kSyndicationFeedManager::getMrssEntry($entry, $this->syndicationFeedDB, $this->syndicationFeed->landingPage, $xslParams);
             break;
         case self::STATE_FOOTER:
             echo kSyndicationFeedManager::getMrssFooter($this->syndicationFeed->name, $this->syndicationFeed->feedLandingPage, $this->syndicationFeed->feedDescription, $this->syndicationFeedDB);
             break;
     }
 }
 private function renderKalturaFeed()
 {
     $syndicationFeedDB = syndicationFeedPeer::retrieveByPK($this->syndicationFeed->id);
     if (!$syndicationFeedDB) {
         throw new Exception("Feed Id not found");
     }
     //header xml
     echo kSyndicationFeedManager::getMrssHeader($this->syndicationFeed->name, $this->syndicationFeed->feedLandingPage, $this->syndicationFeed->feedDescription, $syndicationFeedDB);
     //items
     while ($entry = $this->getNextEntry()) {
         // in case no video player is requested by user and the entry is mix, skip it
         if ($entry->getType() === entryType::MIX && !$this->syndicationFeed->allowEmbed) {
             continue;
         }
         echo kSyndicationFeedManager::getMrssEntry($entry, $syndicationFeedDB, $this->syndicationFeed->landingPage);
     }
     echo kSyndicationFeedManager::getMrssFooter($this->syndicationFeed->name, $this->syndicationFeed->feedLandingPage, $this->syndicationFeed->feedDescription, $syndicationFeedDB);
 }