desc = 'I am mother'; R::store( $mother ); $child = R::dispense( 'child' ); $child->mother = $mother; $child->desc = 'I am child'; $id = R::store( $child ); R::findOne( 'child', ' id = ?', array( $id ) ); R::find( 'child', ' id = ? ', array( $id ) ); R::load( 'child', $id ); } } /** * Mock Model. */ class Model_Mother extends SimpleModel { public function open() { $bean = $this->bean; // $this & $bean are both referencing child incorrectly! asrt( $this->bean->desc, 'I am mother' ); } } /** * Mock Model. */ class Model_Child extends SimpleModel { public function open() { $this->bean->mother; asrt( $this->bean->desc, 'I am child' ); } }