Ejemplo n.º 1
0
 public function export(WriterResult $result)
 {
     switch ($result->getType()) {
         case WriterInterface::JSON:
         case WriterInterface::XML:
             return parent::export($result);
             break;
         case WriterInterface::ATOM:
             $entry = $result->getWriter()->createEntry();
             $entry->setTitle($this->friendName);
             $entry->setId('urn:uuid:' . $this->friendGlobalId);
             $entry->setUpdated($this->getDate());
             $entry->addAuthor($this->authorName, $this->authorProfileUrl);
             $entry->addLink($this->friendProfileUrl, 'alternate', 'text/html');
             $entry->setContent($this, 'application/xml');
             return $entry;
             break;
         default:
             throw new Exception('Writer is not supported');
             break;
     }
 }