Closed TwinMist closed 5 years ago
You can just pass an instance of UnboundedPositiveInt that you create ahead of time.
$total = 'Unlimited'; // or 100
$unboundedPositiveInt = new UnboundedPositiveInt();
if ($total === 'Unlimited') {
$unboundedPositiveInt->setUnlimited(true);
} else {
$unboundedPositiveInt->setQuantity($total);
}
$request = (new GroupServiceModifyAuthorizationListRequest())
->setServiceProviderId($serviceProviderId)
->setGroupId($groupId)
->setServicePackAuthorization([
(new ServicePackAuthorization())
->setServicePackName($service)
->setAuthorizedQuantity($unboundedPositiveInt)
]);
Hi is there a way within the request, if the setquantity($total) is not set then use ->setUnlimited(true) and vise versa? thanks. $request = (new GroupServiceModifyAuthorizationListRequest()) ->setServiceProviderId($serviceProviderId) ->setGroupId($groupId) ->setServicePackAuthorization([ (new ServicePackAuthorization()) ->setServicePackName($service) ->setAuthorizedQuantity( (new UnboundedPositiveInt()) ->setquantity($total)),