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