private function validateMemberPaymentType() {
    /** @var \Drupal\node\Entity\Node $campaign Campaign node object. */
    $campaign = $this->getCampaign();
    /** @var \Drupal\openy_campaign\Entity\Member $member Temporary Member object. Will be saved by submit. */
    $member = $this->getMember();

    $campaignPaymentTypes = $campaign->get('field_campaign_payment_types')->getString();
    $memberPaymentType = $member->getPaymentType();

    if (in_array($memberPaymentType, explode(', ', $campaignPaymentTypes))) {
      return ['status' => TRUE, 'error' => ''];
    }

    return ['status' => FALSE, 'error' => t('Payment type does not match types: @types.', ['@types' => $campaignPaymentTypes])->render()];
  }
private function validateMemberPaymentType() {
    /** @var \Drupal\node\Entity\Node $campaign Campaign node object. */
    $campaign = $this->getCampaign();
    /** @var \Drupal\openy_campaign\Entity\Member $member Temporary Member object. Will be saved by submit. */
    $member = $this->getMember();

    $campaignPaymentTypes = $campaign->get('field_campaign_payment_types')->getString();
    $memberPaymentType = $member->getPaymentType();

    if (in_array($memberPaymentType, explode(', ', $campaignPaymentTypes))) {
      return ['status' => TRUE, 'error' => ''];
    }

    return ['status' => FALSE, 'error' => t('Payment type does not match types: @types.', ['@types' => $campaignPaymentTypes])->render()];
  }
private function validateMemberPaymentType ( ) { /** @var \Drupal\node\Entity\Node $campaign Campaign node object. */ $ campaign = $ this -> getCampaign ( ) ; /** @var \Drupal\openy_campaign\Entity\Member $member Temporary Member object. Will be saved by submit. */ $ member = $ this -> getMember ( ) ; $ campaignPaymentTypes = $ campaign -> get ( 'field_campaign_payment_types' ) -> getString ( ) ; $ memberPaymentType = $ member -> getPaymentType ( ) ; if ( in_array ( $ memberPaymentType , explode ( ', ' , $ campaignPaymentTypes ) ) ) { return [ 'status' => TRUE , 'error' => '' ] ; } return [ 'status' => FALSE , 'error' => t ( 'Payment type does not match types: @types.' , [ '@types' => $ campaignPaymentTypes ] ) -> render ( ) ] ; }
Check if the member age fit to the Campaign payment types.

@return array Array with status and error message.
Check if the member age fit to the Campaign payment types .