I am trying to set multiple entities depending on if the values exist or not.
if ($guestMinorCheckout === 'Yes') {
$optionInfo = 'adult-authorized';
$value = 'yes|';
foreach ($guestMinorCheckout as $guestInfo) {
if (!is_null($guestContactCheckInOutPhone)) {
$option = new EventAttendeeOption();
$option->setOption('adult-authorized-sms');
$option->setValue($guestContactCheckInOutPhone);
}
if (!is_null($guestContactCheckInOutEmail)) {
$option = new EventAttendeeOption();
$option->setOption('adult-authorized-email');
$option->setValue($guestContactCheckInOutEmail);
}
}
}
this code above doesn't work but its what I am trying to accomplish.
I am getting this data from an API call, therefore the values may or may not exist. if they do exits id like to set to those values.