示例#1
0
 /**
  * @return FeedChannel
  **/
 public function makeChannel(\SimpleXMLElement $xmlFeed)
 {
     if (!isset($xmlFeed->channel) || !isset($xmlFeed->channel->title)) {
         throw new WrongStateException('there are no channels in given rss');
     }
     $feedChannel = FeedChannel::create((string) $xmlFeed->channel->title);
     if (isset($xmlFeed->channel->link)) {
         $feedChannel->setLink((string) $xmlFeed->channel->link);
     }
     return $feedChannel;
 }
示例#2
0
 /**
  * @return FeedChannel
  **/
 public function makeChannel(\SimpleXMLElement $xmlFeed)
 {
     $feedChannel = FeedChannel::create((string) $xmlFeed->title);
     if (isset($xmlFeed->link)) {
         if (is_array($xmlFeed->link)) {
             $feedChannel->setLink((string) $xmlFeed->link[0]);
         } else {
             $feedChannel->setLink((string) $xmlFeed->link);
         }
     }
     return $feedChannel;
 }