Code Duplication    Length = 8-8 lines in 2 locations

lib/Doctrine/ODM/MongoDB/Persisters/PersistenceBuilder.php 2 locations

@@ 176-183 (lines=8) @@
173
                    $updateData['$unset'][$mapping['name']] = true;
174
175
                // Update existing embedded document
176
                } else {
177
                    $update = $this->prepareUpdateData($new);
178
                    foreach ($update as $cmd => $values) {
179
                        foreach ($values as $key => $value) {
180
                            $updateData[$cmd][$mapping['name'] . '.' . $key] = $value;
181
                        }
182
                    }
183
                }
184
185
            // @ReferenceMany, @EmbedMany
186
            } elseif (isset($mapping['association']) && $mapping['type'] === 'many' && $new) {
@@ 273-280 (lines=8) @@
270
                } elseif ( ! $new) {
271
272
                // Update existing embedded document
273
                } else {
274
                    $update = $this->prepareUpsertData($new);
275
                    foreach ($update as $cmd => $values) {
276
                        foreach ($values as $key => $value) {
277
                            $updateData[$cmd][$mapping['name'] . '.' . $key] = $value;
278
                        }
279
                    }
280
                }
281
282
            // @ReferenceOne
283
            } elseif (isset($mapping['association']) && $mapping['association'] === ClassMetadata::REFERENCE_ONE) {