R :: store在模型方法中不起作用[REDBEAN]

I am trying to integrate REDBEAN into my web application.

I would like my model method to complete the "storing process" as well.

When I add

R::store($this) 

in the last model-method it fails. How can I accomplish the same ?

I posted the same question on the redbean google forum and got the answer.

https://groups.google.com/group/redbeanorm/browse_thread/thread/bcac973baabdd7bb