private function mergeRankObjects(\UR\DB\NewBundle\Entity\Rank $dataMasterRank, \UR\DB\NewBundle\Entity\Rank $toBeDeletedRank) { $dataMasterRank->setLabel($this->mergeStrings($dataMasterRank->getLabel(), $toBeDeletedRank->getLabel())); $dataMasterRank->setClass($this->mergeStrings($dataMasterRank->getClass(), $toBeDeletedRank->getClass())); $dataMasterRank->setCountry($this->mergeCountryObject($dataMasterRank->getCountry(), $toBeDeletedRank->getCountry())); $dataMasterRank->setTerritory($this->mergeTerritoryObject($dataMasterRank->getTerritory(), $toBeDeletedRank->getTerritory())); $dataMasterRank->setLocation($this->mergeLocationObject($dataMasterRank->getLocation(), $toBeDeletedRank->getLocation())); $dataMasterRank->setFromDate($this->mergeDateReference($dataMasterRank->getFromDate(), $toBeDeletedRank->getFromDate())); $dataMasterRank->setToDate($this->mergeDateReference($dataMasterRank->getToDate(), $toBeDeletedRank->getToDate())); $dataMasterRank->setProvenDate($this->mergeDateReference($dataMasterRank->getProvenDate(), $toBeDeletedRank->getProvenDate())); $dataMasterRank->setComment($this->mergeStrings($dataMasterRank->getComment(), $toBeDeletedRank->getComment())); $toBeDeletedRank->setFromDate(null); $toBeDeletedRank->setProvenDate(null); $toBeDeletedRank->setToDate(null); return $dataMasterRank; }
public function matchingRank(\UR\DB\NewBundle\Entity\Rank $rankOne, \UR\DB\NewBundle\Entity\Rank $rankTwo, $allowLessInformation = false) { $this->LOGGER->debug("Comparing " . $rankOne . " with " . $rankTwo); if (!$this->compareStrings($rankOne->getLabel(), $rankTwo->getLabel(), $allowLessInformation)) { return false; } if (!$this->compareStrings($rankOne->getClass(), $rankTwo->getClass(), $allowLessInformation)) { return false; } if (!$this->compareCountries($rankOne->getCountry(), $rankTwo->getCountry(), $allowLessInformation)) { return false; } if (!$this->compareTerritories($rankOne->getTerritory(), $rankTwo->getTerritory(), $allowLessInformation)) { return false; } if (!$this->compareLocations($rankOne->getLocation(), $rankTwo->getLocation(), $allowLessInformation)) { return false; } if ($this->unmatchedArrays($rankOne->getFromDate(), $rankTwo->getFromDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($rankOne->getToDate(), $rankTwo->getToDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($rankOne->getProvenDate(), $rankTwo->getProvenDate(), "date", $allowLessInformation)) { return false; } return true; }