/** * @param \Product\Entity\Product|Post $entity */ public function addEntityInfo($entity) { $this->writer->startElement('url'); $this->writer->writeElement('lastmod', date(\Datetime::ATOM, time())); $this->writer->startElement('image:image'); if ($entity instanceof Post) { $this->writer->writeElement('image:loc', "http://www.infolightingco.com/images/posts/" . $entity->getThumbnail()); $this->writer->writeElement('loc', "http://www.infolightingco.com/news/" . $entity->getUrl()); } else { $this->writer->writeElement('image:loc', "http://www.infolightingco.com/images/posts/" . $entity->getThumbnail()); $this->writer->writeElement('loc', "http://www.infolightingco.com/products/view/" . $entity->getProductNumber()); } $this->writer->endElement(); $this->writer->endElement(); }