/**
  * Parse subscription entry
  *
  * @access public
  * @return Subscription
  */
 public function parse()
 {
     $this->subscription->setCategory($this->findCategory());
     $this->subscription->setTitle($this->findTitle());
     $this->subscription->setFeedUrl($this->findFeedUrl());
     $this->subscription->setSiteUrl($this->findSiteUrl());
     $this->subscription->setType($this->findType());
     $this->subscription->setDescription($this->findDescription());
     return $this->subscription;
 }
 /**
  * Build subscription entry
  *
  * @access public
  * @param  Subscription $subscription
  * @return DOMElement
  */
 protected function buildSubscription(Subscription $subscription)
 {
     $outlineElement = $this->document->createElement('outline');
     $outlineElement->setAttribute('type', $subscription->getType() ?: 'rss');
     $outlineElement->setAttribute('text', $subscription->getTitle() ?: $subscription->getFeedUrl());
     $outlineElement->setAttribute('xmlUrl', $subscription->getFeedUrl());
     if ($subscription->getTitle() !== '') {
         $outlineElement->setAttribute('title', $subscription->getTitle());
     }
     if ($subscription->getDescription() !== '') {
         $outlineElement->setAttribute('description', $subscription->getDescription());
     }
     if ($subscription->getSiteUrl() !== '') {
         $outlineElement->setAttribute('htmlUrl', $subscription->getSiteUrl());
     }
     return $outlineElement;
 }