Code Duplication    Length = 10-11 lines in 2 locations

model/DataObject.php 2 locations

@@ 1009-1018 (lines=10) @@
1006
1007
		// merge relations
1008
		if($includeRelations) {
1009
			if($manyMany = $this->manyMany()) {
1010
				foreach($manyMany as $relationship => $class) {
1011
					$leftComponents = $leftObj->getManyManyComponents($relationship);
1012
					$rightComponents = $rightObj->getManyManyComponents($relationship);
1013
					if($rightComponents && $rightComponents->exists()) {
1014
						$leftComponents->addMany($rightComponents->column('ID'));
1015
					}
1016
					$leftComponents->write();
1017
				}
1018
			}
1019
1020
			if($hasMany = $this->hasMany()) {
1021
				foreach($hasMany as $relationship => $class) {
@@ 1020-1030 (lines=11) @@
1017
				}
1018
			}
1019
1020
			if($hasMany = $this->hasMany()) {
1021
				foreach($hasMany as $relationship => $class) {
1022
					$leftComponents = $leftObj->getComponents($relationship);
1023
					$rightComponents = $rightObj->getComponents($relationship);
1024
					if($rightComponents && $rightComponents->exists()) {
1025
						$leftComponents->addMany($rightComponents->column('ID'));
1026
					}
1027
					$leftComponents->write();
1028
				}
1029
1030
			}
1031
		}
1032
1033
		return true;