Code Duplication    Length = 7-7 lines in 2 locations

model/DataObject.php 2 locations

@@ 1609-1615 (lines=7) @@
1606
		}
1607
1608
		// If we haven't been written yet, we can't save these relations, so use a list that handles this case
1609
		if(!$this->ID) {
1610
			if(!isset($this->unsavedRelations[$componentName])) {
1611
				$this->unsavedRelations[$componentName] =
1612
					new UnsavedRelationList($this->class, $componentName, $componentClass);
1613
			}
1614
			return $this->unsavedRelations[$componentName];
1615
		}
1616
1617
		// Determine type and nature of foreign relation
1618
		$joinField = $this->getRemoteJoinField($componentName, 'has_many', $polymorphic);
@@ 1773-1779 (lines=7) @@
1770
		}
1771
1772
		// If we haven't been written yet, we can't save these relations, so use a list that handles this case
1773
		if(!$this->ID) {
1774
			if(!isset($this->unsavedRelations[$componentName])) {
1775
				$this->unsavedRelations[$componentName] =
1776
					new UnsavedRelationList($parentClass, $componentName, $componentClass);
1777
			}
1778
			return $this->unsavedRelations[$componentName];
1779
		}
1780
1781
		$extraFields = $this->manyManyExtraFieldsForComponent($componentName) ?: array();
1782
		$result = ManyManyList::create($componentClass, $table, $componentField, $parentField, $extraFields);