Example #1
0
 /**
  * Extract the author email
  *
  * @param \Nekland\Bundle\FeedBundle\Item\ExtendedItemInterface $item
  * @return string|null
  */
 private function getAuthor(ItemInterface $item)
 {
     $authorData = $item->getFeedAuthor();
     $author = '';
     if (isset($authorData['name'])) {
         $author .= $authorData['name'];
     }
     if (isset($authorData['email'])) {
         $author .= empty($author) ? $authorData['email'] : ' ' . $authorData['email'];
     }
     if (!empty($author)) {
         return $author;
     }
     return null;
 }