Change private functions to protected so LicenseAvailabilityCheckerExistingRights can be extended

Created on 5 September 2023, 10 months ago
Updated 12 November 2023, 8 months ago

Problem/Motivation

I'm overwriting the service commerce_order.availability_checker because I want to assign licenses based on a factor other than if a user is the one who purchased it (we have "Household" licenses for example). This is working well, but I am not overwriting the checkPurchasable or getRenewalStartTimeMessage methods. But since they're private, I have to copy/paste them into my extended class but leave them as-is.

With the first method, I worry that in the future these will change and we won't know to update our versions of the code. I could, alternatively, do something like this: https://stackoverflow.com/a/61921662, but that feels a bit clever/confusing for future maintenance as well.

Proposed resolution

Is there some fundamental reason to keep those two methods "private", or could they be "protected"?.

Remaining tasks

Determine an approach and implement

User interface changes

None

API changes

None

Data model changes

✨ Feature request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States mariacha1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024