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

cleanup ProductOption accessor/mutator and fix fields casting #1783

Merged
merged 6 commits into from
Aug 19, 2024

Conversation

wychoong
Copy link
Contributor

@wychoong wychoong commented May 26, 2024

with the accessor/mutator defined for the name and label fields, the cast is never used
this PR removed the redundant accessor/mutator and changed to AsArrayObject cast instead of As Collection

using AsArrayObject allows following usage
image

as compared to previous accessor/mutator json_encode
image

or AsCollection
image

Copy link

vercel bot commented May 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 19, 2024 11:28am

alecritson
alecritson previously approved these changes May 28, 2024
@alecritson alecritson marked this pull request as draft May 28, 2024 09:37
@glennjacobs
Copy link
Contributor

@alecritson @wychoong is this still needed? I can see it's draft, but at the same time Alec approved it.

@wychoong
Copy link
Contributor Author

Not sure why it’s changed to draft

@wychoong wychoong changed the title fix bad merge cleanup ProductOption accessor/mutator and fix fields casting Jul 31, 2024
@wychoong wychoong marked this pull request as ready for review July 31, 2024 15:45
@wychoong
Copy link
Contributor Author

@glennjacobs I took a fresh look on it, this should be the proper way. updated my findings in the first comment.

It also makes me think should all the usage of AsCollection cast in the models to be reviewed and changed to AsArrayObject

@alecritson alecritson merged commit 63313d2 into lunarphp:1.x Aug 19, 2024
22 checks passed
@wychoong wychoong deleted the patch-4 branch August 19, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants