Closed Lynesth closed 6 years ago
I like this approach very much, I think we should try to turn this into a plugin or something. I don't think it's wise to implement the bits of logic required to make this work throughout the entire codebase.
I guess you need https://github.com/gabordemooij/redbean/pull/632 for this to work?
This currently cannot work for Facade static function (the OODB isn't accessed the same way).
And yes, I need #632 for this :)
I am taking a shot at this as well...
Nice.
I thought I should take it step by step, so I'm actually making a PR (which I don't think you'll like much :p) regarding part of this issue.
What about this:
https://gist.github.com/gabordemooij/6feefc4964cafa766a085557d8900389
It seems to work, and requires almost no changes in RedBeanPHP at all.
@gabordemooij Can I expect anything regarding this matter ? I understand that the way I proposed it (#634 / #641) surely wasn't how it should be done, but are you considering implementing this functionnality or not ?
I'm not being agressive or anything, just need to know so that I can really work on this on my own if that's the case :)
I have created a plugin and waiting for your feedback...
Op di 12 jun. 2018 04:09 schreef Lynesth notifications@github.com:
@gabordemooij https://github.com/gabordemooij Can I expect anything regarding this matter ? I understand that the way I proposed it (#634 https://github.com/gabordemooij/redbean/pull/634 / #641 https://github.com/gabordemooij/redbean/pull/641) surely wasn't how it should be done, but are you considering implementing this functionnality or not ?
I'm not being agressive or anything, just need to know so that I can really work on this on my own if that's the case :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gabordemooij/redbean/issues/629#issuecomment-396442870, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFe4jW-zFSEOjU7uQAiqRNPPsiB5oP6ks5t7yL1gaJpZM4TgHqI .
I actually commented on this gist on the same day you posted it, I think you may have missed that :)
Ok, I must have missed that, sorry. I will look into it asap.
Op di 12 jun. 2018 06:53 schreef Lynesth notifications@github.com:
I actually commented on this gist on the same day you posted it, I think you may have missed that :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gabordemooij/redbean/issues/629#issuecomment-396465184, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFe4gG-NU1r9dQJyIiuNMrvB4fXVEryks5t70ksgaJpZM4TgHqI .
I will continue to work on this as a plugin but it will not be a core 'feature' of RedBeanPHP.
So I'm currently working on a big project with many databases and I have to select the correct database each time I need to do something on a bean to make sure it's the correct one.
So I was thinking, why not have each bean remember which toolbox it needs to access once it's been dispensed ?
I'm currently doing it using a custom beanHelper that I set for each new database:
Is this something we'd be interesting in providing inside RedBean ? If so, should it be the default behavior ? Only as an option ?
Let me know what you think @gabordemooij and anyone else using RedBean regularly, and if you're interested I'll submit a PR.
Lyn.