$model->loadBean($bean);
By the way I have just tried using $bean = $modelfoo->unbox() but that is returning null...
On 15/11/2015 21:36, Mike Whiting wrote:
Sorry.. I jumped the gun a bit. I just found the docs page on models: http://redbeanphp.com/models.
My other question though is if it's possible/valid to get hold of a bean by instantiating a model directly. i.e.
$bean = new Model_Foo();
The reason I'm asking is because I'm interested in integrating redbean with the alice fixture generation tool, which I'm not sure has a way of overriding the default mechanism for instantiating models. I.e. bypassing the R fascade dispense method.
Cheers,
On 15/11/2015 21:23, Mike Whiting wrote:
I appoligise for this seeminly lazy approach in asking the question but I wrote this blog post about taking advantage of Redbean's event system to create model layer code that is run upon bean creation (dispense). Can somone please explaon how the same can be achieved with the latest version of Redbean?
The original post is here: https://mikewhiting.co/2013/mar/13/redbeanmodels
Many thanks,
--
Mike Whiting
DirectorAi-em Ltd
17 Fieldway, West Sussex, RH16 2DDTel: +44(0)7990 570581
Web: ai-em.net
--
Mike Whiting
DirectorAi-em Ltd
17 Fieldway, West Sussex, RH16 2DDTel: +44(0)7990 570581
Web: ai-em.net
--
Mike Whiting
DirectorAi-em Ltd
17 Fieldway, West Sussex, RH16 2DDTel: +44(0)7990 570581
Web: ai-em.net