gabordemooij/redbean — comment on commit a4be7aefcd94a948b015f895aca1f7cb8ee99774
File:  line 0
By abxccd:

After playing around with this feature, I must say I have fallen in love with this feature :)

I use a GenericModel set by ModelFormatter if a specific model does not exist.

I prefer to have models in my project instead of beans, so I am using a wrapper to box() if an instance of OODB_Bean is returned.

Is it possible to add automatic unboxing?

For example in cases where we have established relationships between beans (users having multiple emailaddresses):
$user->emailaddress = $emailaddress.

Where $email is an Model representing the email bean.

Perhaps you could do a check to see that if the object passed in is not an OODB_Bean and contains the function unbox(), then use the unboxed version.