private function processFeaturedArticle($articleData)
 {
     if ($articleData) {
         $article = HailArticle::get()->filter(array('HailID' => $articleData->id))->first();
         if (!$article) {
             $article = new HailArticle();
         }
         $article->importHailData($articleData);
         $heroImage = $article->HeroImageID;
         $article = $article->ID;
     } else {
         $article = null;
     }
     $this->FeaturedArticleID = $article;
     if (isset($heroImage) && $heroImage) {
         $this->HeroImageID = $heroImage;
     }
 }
 public function fetchArticles()
 {
     try {
         $list = HailApi::getArticlesByTag($this->HailID);
     } catch (HailApiException $ex) {
         Debug::warningHandler(E_WARNING, $ex->getMessage(), $ex->getFile(), $ex->getLine(), $ex->getTrace());
         return;
     }
     $hailIdList = array();
     foreach ($list as $hailData) {
         // Build up Hail ID list
         $hailIdList[] = $hailData->id;
         // Check if we can find an existing item.
         $hailObj = HailArticle::get()->filter(array('HailID' => $hailData->id))->First();
         if (!$hailObj) {
             $hailObj = new HailArticle();
         }
         $hailObj->importHailData($hailData);
         $this->Articles()->add($hailObj);
     }
     $this->Articles()->exclude('HailID', $hailIdList)->removeAll();
 }