Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment PropertyBag: Add generic getter, setter methods for convenience #16081

Merged

Conversation

artfulrobot
Copy link
Contributor

Overview

In beginning to work with the new PropertyBag, we're realising some more sugar functions would be helpful.

Before

The only way to access properties was by knowing the getter's name; no way to "get if set otherwise give me a default".

After

You can use generic getter() and generic setter setter(), optionally giving a default.

Comments

Need discussed in #16052

Note: writing the tests for this threw up some interesting cases, esp. around custom property names and aliased property names (which you're not allowed to use because the only code using PropertyBag should know better!)

@civibot
Copy link

civibot bot commented Dec 11, 2019

(Standard links)

@civibot civibot bot added the master label Dec 11, 2019
@eileenmcnaughton eileenmcnaughton changed the base branch from master to 5.21 December 11, 2019 10:35
@civibot civibot bot added 5.21 and removed master labels Dec 11, 2019
@eileenmcnaughton
Copy link
Contributor

I just switched this to the rc as we need to fix what will otherwise be a regression in the rc using this. This is as discussed so MOP

@seamuslee001 seamuslee001 merged commit 1a39ad7 into civicrm:5.21 Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants