src/Models/Publication.php
private function processFeaturedArticle($articleData)
    {
        if ($articleData) {
            $article = Article::get()->filter(['HailID' => $articleData['id']])->first();
            if (!$article) {
                $article = new Article();
                $article->importHailData($articleData);
            }

            $heroImage = $article->HeroImageID;
            $heroVideo = $article->HeroVideoID;

            $article = $article->ID;
        } else {
            $article = null;
        }

        $this->FeaturedArticleID = $article;

        if (isset($heroImage) && $heroImage) {
            $this->HeroImageID = $heroImage;
        }

        if (isset($heroVideo) && $heroVideo) {
            $this->HeroVideoID = $heroVideo;
        }

    }
private function processFeaturedArticle($articleData)
    {
        if ($articleData) {
            $article = Article::get()->filter(['HailID' => $articleData['id']])->first();
            if (!$article) {
                $article = new Article();
                $article->importHailData($articleData);
            }

            $heroImage = $article->HeroImageID;
            $heroVideo = $article->HeroVideoID;

            $article = $article->ID;
        } else {
            $article = null;
        }

        $this->FeaturedArticleID = $article;

        if (isset($heroImage) && $heroImage) {
            $this->HeroImageID = $heroImage;
        }

        if (isset($heroVideo) && $heroVideo) {
            $this->HeroVideoID = $heroVideo;
        }

    }
private function processFeaturedArticle ( $ articleData ) { if ( $ articleData ) { $ article = Article :: get ( ) -> filter ( [ 'HailID' => $ articleData [ 'id' ] ] ) -> first ( ) ; if ( ! $ article ) { $ article = new Article ( ) ; $ article -> importHailData ( $ articleData ) ; } $ heroImage = $ article -> HeroImageID ; $ heroVideo = $ article -> HeroVideoID ; $ article = $ article -> ID ; } else { $ article = null ; } $ this -> FeaturedArticleID = $ article ; if ( isset ( $ heroImage ) && $ heroImage ) { $ this -> HeroImageID = $ heroImage ; } if ( isset ( $ heroVideo ) && $ heroVideo ) { $ this -> HeroVideoID = $ heroVideo ; } }
Attach the featured article to this publication if there is one

@param array $articleData
Attach the featured article to this publication if there is one