Code Duplication    Length = 10-10 lines in 2 locations

code/model/SiteTreeLinkTracking.php 2 locations

@@ 140-149 (lines=10) @@
137
		}
138
139
		// Update the "LinkTracking" many_many
140
		if($record->ID && $record->manyManyComponent('LinkTracking') && ($tracker = $record->LinkTracking())) {
141
			$tracker->removeByFilter(array(
142
				sprintf('"FieldName" = ? AND "%s" = ?', $tracker->getForeignKey())
143
					=> array($fieldName, $record->ID)
144
			));
145
146
			if($linkedPages) foreach($linkedPages as $item) {
147
				$tracker->add($item, array('FieldName' => $fieldName));
148
			}
149
		}
150
151
		// Update the "ImageTracking" many_many
152
		if($record->ID && $record->manyManyComponent('ImageTracking') && ($tracker = $record->ImageTracking())) {
@@ 152-161 (lines=10) @@
149
		}
150
151
		// Update the "ImageTracking" many_many
152
		if($record->ID && $record->manyManyComponent('ImageTracking') && ($tracker = $record->ImageTracking())) {
153
			$tracker->removeByFilter(array(
154
				sprintf('"FieldName" = ? AND "%s" = ?', $tracker->getForeignKey())
155
					=> array($fieldName, $record->ID)
156
			));
157
158
			if($linkedFiles) foreach($linkedFiles as $item) {
159
				$tracker->add($item, array('FieldName' => $fieldName));
160
			}
161
		}
162
	}
163
164
	/**