Skip to content

Commit

Permalink
Merge pull request #134 from jstsch/patch-2
Browse files Browse the repository at this point in the history
Enable automatic storing of models as properties of a bean.
  • Loading branch information
Gabor de Mooij committed Mar 6, 2012
2 parents eac4202 + 69f6c13 commit 5c0054e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RedBean/OODB.php
Expand Up @@ -300,7 +300,8 @@ public function store( RedBean_OODBBean $bean ) {
$tmpCollectionStore = array();
$embeddedBeans = array();
foreach($bean as $p=>$v) {
if ($v instanceof RedBean_OODBBean) {
if ($v instanceof RedBean_OODBBean || $v instanceof RedBean_SimpleModel) {
if ($v instanceof RedBean_SimpleModel) $v = $v->unbox();
$embtype = $v->getMeta('type');
if (!$v->id || $v->getMeta('tainted')) {
$this->store($v);
Expand Down

0 comments on commit 5c0054e

Please sign in to comment.