假设我的文件夹包含人员飞行数据 飞行数据有很多转换
每个翻译都可以参观很多地方
航班有很多过渡
过渡有地方
保存飞行位置时不保存
$flight->folder_id = $flightData['folder_id'];
foreach ($flightData['transitions'] as $transit) {
$transition = R::dispense('transition');
$transition->flight_number = $transit['flight_number'];
foreach ($transit['places'] as $place) {
$place = R::dispense('transitionplaces');
$place->place = $place;
$transition->ownPlaceList[] = $place;
}
$flight->ownFlightList[] = $transition;
}
$flight = R::store($flight);
具有嵌套关系的项目(飞行==>过渡==>位置)
red bean仅保存父级两个关系(飞行==> transition)