/** * Processes an embedded bean. * * @param OODBBean|SimpleModel $embeddedBean the bean or model * * @return integer */ protected function prepareEmbeddedBean($embeddedBean) { if (!$embeddedBean->id || $embeddedBean->getMeta('tainted')) { $this->store($embeddedBean); } return $embeddedBean->id; }
/** * Test if adding SimpleModles to a shared list will auto unbox them. */ public function testSharedListsAutoUnbox() { $boxedBean = R::dispense('boxedbean'); $bean = R::dispense('bean'); $model = new SimpleModel(); $model->loadBean($boxedBean); $bean->ownBoxedbeanList[] = $model; try { R::store($bean); pass(); } catch (\Exception $e) { fail(); } }