@@ 918-927 (lines=10) @@ | ||
915 | ||
916 | // merge relations |
|
917 | if ($includeRelations) { |
|
918 | if ($manyMany = $this->manyMany()) { |
|
919 | foreach ($manyMany as $relationship => $class) { |
|
920 | /** @var DataObject $leftComponents */ |
|
921 | $leftComponents = $leftObj->getManyManyComponents($relationship); |
|
922 | $rightComponents = $rightObj->getManyManyComponents($relationship); |
|
923 | if ($rightComponents && $rightComponents->exists()) { |
|
924 | $leftComponents->addMany($rightComponents->column('ID')); |
|
925 | } |
|
926 | $leftComponents->write(); |
|
927 | } |
|
928 | } |
|
929 | ||
930 | if ($hasMany = $this->hasMany()) { |
|
@@ 930-940 (lines=11) @@ | ||
927 | } |
|
928 | } |
|
929 | ||
930 | if ($hasMany = $this->hasMany()) { |
|
931 | foreach ($hasMany as $relationship => $class) { |
|
932 | $leftComponents = $leftObj->getComponents($relationship); |
|
933 | $rightComponents = $rightObj->getComponents($relationship); |
|
934 | if ($rightComponents && $rightComponents->exists()) { |
|
935 | $leftComponents->addMany($rightComponents->column('ID')); |
|
936 | } |
|
937 | $leftComponents->write(); |
|
938 | } |
|
939 | } |
|
940 | } |
|
941 | ||
942 | return true; |
|
943 | } |