-
Notifications
You must be signed in to change notification settings - Fork 16
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
Active record storage #4
base: active-record-storage
Are you sure you want to change the base?
Active record storage #4
Conversation
Changed the ActiveRecord attributes to be prefixed with an underscore so that ActiveRecord's getters and setters won't clash with the getters and setters required by TokenInterface.
@martynling thanks for sharing! is this working version? I am not yii expert so it would be hard for me to review, in any case I would do it. |
@martynling could you write a chapter |
here's sandbox repo: https://github.com/makasim/PayumYiiSandbox |
@makasim Yes, it's a working version. I'll write the "how to use it" section next week sometime. Glad to share. :-) |
Could it be possible to create TokenActiveRecord that implements TokenInterface? payum expects it. |
same here, why should we hide active record inside the other model. Why not create active record model that implements array access interface? |
I am looking forward to merge it (:. indeed we have to clean things up a bit |
@makasim Sorry for the delay on this - I moved house last weekend and there's a problem getting connected to the Internet. I should be fully back in action next week and will get to work on this then. |
@martynling congrats on moving to new house! |
@martynling any news on this? |
@makasim Still got connection problems... and there have been 2 days of public holiday so no progress. Once I get connected again, I'll get to it. Next week, hopefully. |
@makasim I've added the How to use... chapter this morning. Let me know what you think. |
great! I will try it in my sandbox asap. |
This is a pretty rough but effective means of implementing ActiveRecord storage. I needed ActiveRecord storage working for Payum in a hurry, so found what seemed the simplest solution to me. I suspect that you may want to implement it in a more elegant way, but I did the following:
It needs some tidying up if it were to be merged in... but I'll hold off on doing that since you may not want to merge it in anyway. If you go ahead with a more elegant solution, I'll probably switch to that further down the line.
Anyway, here it is, just in case it's helpful to you or someone else.