@@ 938-947 (lines=10) @@ | ||
935 | ||
936 | // merge relations |
|
937 | if ($includeRelations) { |
|
938 | if ($manyMany = $this->manyMany()) { |
|
939 | foreach ($manyMany as $relationship => $class) { |
|
940 | /** @var DataObject $leftComponents */ |
|
941 | $leftComponents = $leftObj->getManyManyComponents($relationship); |
|
942 | $rightComponents = $rightObj->getManyManyComponents($relationship); |
|
943 | if ($rightComponents && $rightComponents->exists()) { |
|
944 | $leftComponents->addMany($rightComponents->column('ID')); |
|
945 | } |
|
946 | $leftComponents->write(); |
|
947 | } |
|
948 | } |
|
949 | ||
950 | if ($hasMany = $this->hasMany()) { |
|
@@ 950-960 (lines=11) @@ | ||
947 | } |
|
948 | } |
|
949 | ||
950 | if ($hasMany = $this->hasMany()) { |
|
951 | foreach ($hasMany as $relationship => $class) { |
|
952 | $leftComponents = $leftObj->getComponents($relationship); |
|
953 | $rightComponents = $rightObj->getComponents($relationship); |
|
954 | if ($rightComponents && $rightComponents->exists()) { |
|
955 | $leftComponents->addMany($rightComponents->column('ID')); |
|
956 | } |
|
957 | $leftComponents->write(); |
|
958 | } |
|
959 | } |
|
960 | } |
|
961 | ||
962 | return true; |
|
963 | } |