/** * * @param RP_Family_Record $family */ function update_children($family, $options) { if (!isset($options['editMode'])) { RP_Dao_Factory::get_rp_fam_child_dao($this->credentials->prefix)->delete_children($family->id, $this->batch_id); $this->transaction->commit_no_close(); } foreach ($family->children as $child) { $fam_child = new RP_Fam_Child(); $fam_child->fam_id = $family->id; $fam_child->fam_batch_id = $this->batch_id; $fam_child->child_id = $child; $fam_child->indi_batch_id = $this->batch_id; try { $id = RP_Dao_Factory::get_rp_fam_child_dao($this->credentials->prefix)->insert($fam_child); } catch (Exception $e) { error_log($e->getMessage() . "::" . RP_Persona_Helper::trace_caller(), 0); echo $e->getMessage(); throw $e; } } }