Beispiel #1
0
 /**
  * @param SimpleXMLElement $parent
  * @param Logo             $logo
  */
 private function serializeLogo(SimpleXMLElement $parent, Logo $logo)
 {
     $imageXML = $parent->addChild('image');
     $imageXML->addChild('uri', $logo->getURI());
     $imageXML->addChild('link', $logo->getLink() ?: $feed->getURI());
     $imageXML->addChild('title', $logo->getTitle() ?: $feed->getTitle());
     $description = $logo->getDescription();
     $width = $logo->getWidth();
     $height = $logo->getHeight();
     if (!is_null($description)) {
         $imageXML->addChild('description', $description);
     }
     if (!is_null($width)) {
         $imageXML->addChild('width', $width);
     }
     if (!is_null($height)) {
         $imageXML->addChild('height', $height);
     }
 }