public function getUnplayedGames(NodeInterface $campaign) {

    $userData = MemberCampaign::getMemberCampaignData($campaign->id());
    $memberCampaignID = MemberCampaign::findMemberCampaign($userData['membership_id'], $campaign->id());

    $memberGameStorage = $this->entityTypeManager->getStorage('openy_campaign_member_game');

    $query = $memberGameStorage->getQuery();
    $gameIds = $query->condition('member', $memberCampaignID)
      ->execute();

    $games = $memberGameStorage->loadMultiple($gameIds);
    $unplayedGames = [];
    foreach ($games as $game) {
      if (!empty($game->result->value)) {
        continue;
      }

      $unplayedGames[] = $game;
    }
    return $unplayedGames;
  }
public function getUnplayedGames(NodeInterface $campaign) {

    $userData = MemberCampaign::getMemberCampaignData($campaign->id());
    $memberCampaignID = MemberCampaign::findMemberCampaign($userData['membership_id'], $campaign->id());

    $memberGameStorage = $this->entityTypeManager->getStorage('openy_campaign_member_game');

    $query = $memberGameStorage->getQuery();
    $gameIds = $query->condition('member', $memberCampaignID)
      ->execute();

    $games = $memberGameStorage->loadMultiple($gameIds);
    $unplayedGames = [];
    foreach ($games as $game) {
      if (!empty($game->result->value)) {
        continue;
      }

      $unplayedGames[] = $game;
    }
    return $unplayedGames;
  }
public function getUnplayedGames ( NodeInterface $ campaign ) { $ userData = MemberCampaign :: getMemberCampaignData ( $ campaign -> id ( ) ) ; $ memberCampaignID = MemberCampaign :: findMemberCampaign ( $ userData [ 'membership_id' ] , $ campaign -> id ( ) ) ; $ memberGameStorage = $ this -> entityTypeManager -> getStorage ( 'openy_campaign_member_game' ) ; $ query = $ memberGameStorage -> getQuery ( ) ; $ gameIds = $ query -> condition ( 'member' , $ memberCampaignID ) -> execute ( ) ; $ games = $ memberGameStorage -> loadMultiple ( $ gameIds ) ; $ unplayedGames = [ ] ; foreach ( $ games as $ game ) { if ( ! empty ( $ game -> result -> value ) ) { continue ; } $ unplayedGames [ ] = $ game ; } return $ unplayedGames ; }
Get the list of available game chances.

@param \Drupal\node\NodeInterface $campaign

@return array
@throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
Get the list of available game chances .