Code Duplication    Length = 10-11 lines in 2 locations

model/DataObject.php 2 locations

@@ 1024-1033 (lines=10) @@
1021
1022
		// merge relations
1023
		if($includeRelations) {
1024
			if($manyMany = $this->manyMany()) {
1025
				foreach($manyMany as $relationship => $class) {
1026
					$leftComponents = $leftObj->getManyManyComponents($relationship);
1027
					$rightComponents = $rightObj->getManyManyComponents($relationship);
1028
					if($rightComponents && $rightComponents->exists()) {
1029
						$leftComponents->addMany($rightComponents->column('ID'));
1030
					}
1031
					$leftComponents->write();
1032
				}
1033
			}
1034
1035
			if($hasMany = $this->hasMany()) {
1036
				foreach($hasMany as $relationship => $class) {
@@ 1035-1045 (lines=11) @@
1032
				}
1033
			}
1034
1035
			if($hasMany = $this->hasMany()) {
1036
				foreach($hasMany as $relationship => $class) {
1037
					$leftComponents = $leftObj->getComponents($relationship);
1038
					$rightComponents = $rightObj->getComponents($relationship);
1039
					if($rightComponents && $rightComponents->exists()) {
1040
						$leftComponents->addMany($rightComponents->column('ID'));
1041
					}
1042
					$leftComponents->write();
1043
				}
1044
1045
			}
1046
		}
1047
1048
		return true;