28 $metas = OrmUtils::getModelMetadata ( $model );
29 $joinColumns = $metas [
'#joinColumn'] ?? [ ];
30 $manyToManys = $metas [
'#manyToMany'] ?? [ ];
31 foreach ( $joinColumns as $column => $infos ) {
32 if(isset($datas [$column])) {
33 $datas [$infos [
'name']] = $datas [$column];
34 unset ($datas [$column]);
37 foreach ( $manyToManys as $manyColumn => $manyColumnInfos ) {
38 $targetEntity = $manyColumnInfos [
'targetEntity'];
39 $idField = OrmUtils::getFirstKey ( $targetEntity );
40 $v = $datas [$manyColumn] ?? [];
42 foreach ( $v as $values ) {
43 if (isset ( $values [$idField] )) {
44 $ids [] = $values [$idField];
47 $datas [$manyColumn .
'Ids'] = \implode (
',', $ids );
48 unset ( $datas [$manyColumn] );