private function mergeHonourObjects(\UR\DB\NewBundle\Entity\Honour $dataMasterHonour, \UR\DB\NewBundle\Entity\Honour $toBeDeletedHonour) { $dataMasterHonour->setLabel($this->mergeStrings($dataMasterHonour->getLabel(), $toBeDeletedHonour->getLabel())); $dataMasterHonour->setCountry($this->mergeCountryObject($dataMasterHonour->getCountry(), $toBeDeletedHonour->getCountry())); $dataMasterHonour->setTerritory($this->mergeTerritoryObject($dataMasterHonour->getTerritory(), $toBeDeletedHonour->getTerritory())); $dataMasterHonour->setLocation($this->mergeLocationObject($dataMasterHonour->getLocation(), $toBeDeletedHonour->getLocation())); $dataMasterHonour->setFromDate($this->mergeDateReference($dataMasterHonour->getFromDate(), $toBeDeletedHonour->getFromDate())); $dataMasterHonour->setToDate($this->mergeDateReference($dataMasterHonour->getToDate(), $toBeDeletedHonour->getToDate())); $dataMasterHonour->setProvenDate($this->mergeDateReference($dataMasterHonour->getProvenDate(), $toBeDeletedHonour->getProvenDate())); $dataMasterHonour->setComment($this->mergeStrings($dataMasterHonour->getComment(), $toBeDeletedHonour->getComment())); $toBeDeletedHonour->setFromDate(null); $toBeDeletedHonour->setProvenDate(null); $toBeDeletedHonour->setToDate(null); return $dataMasterHonour; }
public function matchingHonour(\UR\DB\NewBundle\Entity\Honour $honourOne, \UR\DB\NewBundle\Entity\Honour $honourTwo, $allowLessInformation = false) { $this->LOGGER->debug("Comparing " . $honourOne . " with " . $honourTwo); if (!$this->compareStrings($honourOne->getLabel(), $honourTwo->getLabel(), $allowLessInformation)) { return false; } if (!$this->compareCountries($honourOne->getCountry(), $honourTwo->getCountry(), $allowLessInformation)) { return false; } if (!$this->compareTerritories($honourOne->getTerritory(), $honourTwo->getTerritory(), $allowLessInformation)) { return false; } if (!$this->compareLocations($honourOne->getLocation(), $honourTwo->getLocation(), $allowLessInformation)) { return false; } if ($this->unmatchedArrays($honourOne->getFromDate(), $honourTwo->getFromDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($honourOne->getToDate(), $honourTwo->getToDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($honourOne->getProvenDate(), $honourTwo->getProvenDate(), "date", $allowLessInformation)) { return false; } return true; }