Code Duplication    Length = 10-11 lines in 2 locations

model/DataObject.php 2 locations

@@ 994-1003 (lines=10) @@
991
992
		// merge relations
993
		if($includeRelations) {
994
			if($manyMany = $this->manyMany()) {
995
				foreach($manyMany as $relationship => $class) {
996
					$leftComponents = $leftObj->getManyManyComponents($relationship);
997
					$rightComponents = $rightObj->getManyManyComponents($relationship);
998
					if($rightComponents && $rightComponents->exists()) {
999
						$leftComponents->addMany($rightComponents->column('ID'));
1000
					}
1001
					$leftComponents->write();
1002
				}
1003
			}
1004
1005
			if($hasMany = $this->hasMany()) {
1006
				foreach($hasMany as $relationship => $class) {
@@ 1005-1015 (lines=11) @@
1002
				}
1003
			}
1004
1005
			if($hasMany = $this->hasMany()) {
1006
				foreach($hasMany as $relationship => $class) {
1007
					$leftComponents = $leftObj->getComponents($relationship);
1008
					$rightComponents = $rightObj->getComponents($relationship);
1009
					if($rightComponents && $rightComponents->exists()) {
1010
						$leftComponents->addMany($rightComponents->column('ID'));
1011
					}
1012
					$leftComponents->write();
1013
				}
1014
1015
			}
1016
1017
			if($hasOne = $this->hasOne()) {
1018
				foreach($hasOne as $relationship => $class) {