private function expandNews (array $rawNewsItems, Paginated\News $news)
    {
        foreach ($rawNewsItems as $rawNewsItem) {
            $newsItem = new Downloaded\NewsItem(
                $rawNewsItem->title,
                $rawNewsItem->content,
                $rawNewsItem->thumb_media_id
            );
            
            if (strlen($rawNewsItem->author) > 0) {
                $newsItem = $newsItem->withAuthor($rawNewsItem->author);
            }
            
            if (strlen($rawNewsItem->content_source_url) > 0) {
                $newsItem = $newsItem->withURL($rawNewsItem->content_source_url);
            }
            
            if (strlen($rawNewsItem->digest) > 0) {
                $newsItem = $newsItem->withSummary($rawNewsItem->digest);
            }
            
            if (isset($rawNewsItem->show_cover_pic)) {
                $newsItem = $newsItem->withImageShowing(!! $rawNewsItem->show_cover_pic);
            }
            
            if (strlen($rawNewsItem->url) > 0) {
                $newsItem = $newsItem->withDisplayURL($rawNewsItem->url);
            }
            
            if (isset($rawNewsItem->thumb_url) && strlen($rawNewsItem->thumb_url) > 0) {
                $newsItem = $newsItem->withThumbnailURL($rawNewsItem->thumb_url);
            }
            
            $news = $news->withItem($newsItem);
        }

        return $news;
    }
private function expandNews (array $rawNewsItems, Paginated\News $news)
    {
        foreach ($rawNewsItems as $rawNewsItem) {
            $newsItem = new Downloaded\NewsItem(
                $rawNewsItem->title,
                $rawNewsItem->content,
                $rawNewsItem->thumb_media_id
            );
            
            if (strlen($rawNewsItem->author) > 0) {
                $newsItem = $newsItem->withAuthor($rawNewsItem->author);
            }
            
            if (strlen($rawNewsItem->content_source_url) > 0) {
                $newsItem = $newsItem->withURL($rawNewsItem->content_source_url);
            }
            
            if (strlen($rawNewsItem->digest) > 0) {
                $newsItem = $newsItem->withSummary($rawNewsItem->digest);
            }
            
            if (isset($rawNewsItem->show_cover_pic)) {
                $newsItem = $newsItem->withImageShowing(!! $rawNewsItem->show_cover_pic);
            }
            
            if (strlen($rawNewsItem->url) > 0) {
                $newsItem = $newsItem->withDisplayURL($rawNewsItem->url);
            }
            
            if (isset($rawNewsItem->thumb_url) && strlen($rawNewsItem->thumb_url) > 0) {
                $newsItem = $newsItem->withThumbnailURL($rawNewsItem->thumb_url);
            }
            
            $news = $news->withItem($newsItem);
        }

        return $news;
    }
private function expandNews ( array $ rawNewsItems , Paginated \ News $ news ) { foreach ( $ rawNewsItems as $ rawNewsItem ) { $ newsItem = new Downloaded \ NewsItem ( $ rawNewsItem -> title , $ rawNewsItem -> content , $ rawNewsItem -> thumb_media_id ) ; if ( strlen ( $ rawNewsItem -> author ) > 0 ) { $ newsItem = $ newsItem -> withAuthor ( $ rawNewsItem -> author ) ; } if ( strlen ( $ rawNewsItem -> content_source_url ) > 0 ) { $ newsItem = $ newsItem -> withURL ( $ rawNewsItem -> content_source_url ) ; } if ( strlen ( $ rawNewsItem -> digest ) > 0 ) { $ newsItem = $ newsItem -> withSummary ( $ rawNewsItem -> digest ) ; } if ( isset ( $ rawNewsItem -> show_cover_pic ) ) { $ newsItem = $ newsItem -> withImageShowing ( ! ! $ rawNewsItem -> show_cover_pic ) ; } if ( strlen ( $ rawNewsItem -> url ) > 0 ) { $ newsItem = $ newsItem -> withDisplayURL ( $ rawNewsItem -> url ) ; } if ( isset ( $ rawNewsItem -> thumb_url ) && strlen ( $ rawNewsItem -> thumb_url ) > 0 ) { $ newsItem = $ newsItem -> withThumbnailURL ( $ rawNewsItem -> thumb_url ) ; } $ news = $ news -> withItem ( $ newsItem ) ; } return $ news ; }
Expands the given news media, with its items into an object.

@param array          $rawNewsItems
@param Paginated\News $news

@return Paginated\News
Expands the given news media with its items into an object .