public function getWinnerStream(NodeInterface $campaign) {
    $winners = [];
    $streamType = $campaign->get('field_campaign_stream_type')->getString();
    switch ($streamType) {
      case 'all':
        $instantWinners = $this->getWinnersOfType('instant', $campaign->id());
        $visitGoalAchived = $this->getWinnersOfType('visit', $campaign->id());

        $winners = array_merge($instantWinners, $visitGoalAchived);
        break;

      case 'instant':
        $winners = $this->getWinnersOfType('instant', $campaign->id());
        break;

      case 'visit':
        $winners = $this->getWinnersOfType('visit', $campaign->id());
        break;

      default:
        break;
    }
    shuffle($winners);
    return $winners;
  }
public function getWinnerStream(NodeInterface $campaign) {
    $winners = [];
    $streamType = $campaign->get('field_campaign_stream_type')->getString();
    switch ($streamType) {
      case 'all':
        $instantWinners = $this->getWinnersOfType('instant', $campaign->id());
        $visitGoalAchived = $this->getWinnersOfType('visit', $campaign->id());

        $winners = array_merge($instantWinners, $visitGoalAchived);
        break;

      case 'instant':
        $winners = $this->getWinnersOfType('instant', $campaign->id());
        break;

      case 'visit':
        $winners = $this->getWinnersOfType('visit', $campaign->id());
        break;

      default:
        break;
    }
    shuffle($winners);
    return $winners;
  }
public function getWinnerStream ( NodeInterface $ campaign ) { $ winners = [ ] ; $ streamType = $ campaign -> get ( 'field_campaign_stream_type' ) -> getString ( ) ; switch ( $ streamType ) { case 'all' : $ instantWinners = $ this -> getWinnersOfType ( 'instant' , $ campaign -> id ( ) ) ; $ visitGoalAchived = $ this -> getWinnersOfType ( 'visit' , $ campaign -> id ( ) ) ; $ winners = array_merge ( $ instantWinners , $ visitGoalAchived ) ; break ; case 'instant' : $ winners = $ this -> getWinnersOfType ( 'instant' , $ campaign -> id ( ) ) ; break ; case 'visit' : $ winners = $ this -> getWinnersOfType ( 'visit' , $ campaign -> id ( ) ) ; break ; default : break ; } shuffle ( $ winners ) ; return $ winners ; }
Gets the active winner stream for display on each campaign and landing page.

@param \Drupal\node\NodeInterface $campaign

@return array
Gets the active winner stream for display on each campaign and landing page .