Ejemplo n.º 1
0
 private function mergeRoadOfLifeObjects(\UR\DB\NewBundle\Entity\RoadOfLife $dataMasterRoadOfLife, \UR\DB\NewBundle\Entity\RoadOfLife $toBeDeletedRoadOfLife)
 {
     $dataMasterRoadOfLife->setLabel($this->mergeStrings($dataMasterRoadOfLife->getLabel(), $toBeDeletedRoadOfLife->getLabel()));
     $dataMasterRoadOfLife->setCountry($this->mergeCountryObject($dataMasterRoadOfLife->getCountry(), $toBeDeletedRoadOfLife->getCountry()));
     $dataMasterRoadOfLife->setTerritory($this->mergeTerritoryObject($dataMasterRoadOfLife->getTerritory(), $toBeDeletedRoadOfLife->getTerritory()));
     $dataMasterRoadOfLife->setLocation($this->mergeLocationObject($dataMasterRoadOfLife->getLocation(), $toBeDeletedRoadOfLife->getLocation()));
     $dataMasterRoadOfLife->setFromDate($this->mergeDateReference($dataMasterRoadOfLife->getFromDate(), $toBeDeletedRoadOfLife->getFromDate()));
     $dataMasterRoadOfLife->setToDate($this->mergeDateReference($dataMasterRoadOfLife->getToDate(), $toBeDeletedRoadOfLife->getToDate()));
     $dataMasterRoadOfLife->setProvenDate($this->mergeDateReference($dataMasterRoadOfLife->getProvenDate(), $toBeDeletedRoadOfLife->getProvenDate()));
     $dataMasterRoadOfLife->setComment($this->mergeStrings($dataMasterRoadOfLife->getComment(), $toBeDeletedRoadOfLife->getComment()));
     $dataMasterRoadOfLife->setJob($this->mergeJobObject($dataMasterRoadOfLife->getJob(), $toBeDeletedRoadOfLife->getJob()));
     $dataMasterRoadOfLife->setOriginCountry($this->mergeCountryObject($dataMasterRoadOfLife->getOriginCountry(), $toBeDeletedRoadOfLife->getOriginCountry()));
     $dataMasterRoadOfLife->setOriginTerritory($this->mergeTerritoryObject($dataMasterRoadOfLife->getOriginTerritory(), $toBeDeletedRoadOfLife->getOriginTerritory()));
     $toBeDeletedRoadOfLife->setFromDate(null);
     $toBeDeletedRoadOfLife->setProvenDate(null);
     $toBeDeletedRoadOfLife->setToDate(null);
     return $dataMasterRoadOfLife;
 }
Ejemplo n.º 2
0
 public function matchingRoadOfLife(\UR\DB\NewBundle\Entity\RoadOfLife $roadOfLifeOne, \UR\DB\NewBundle\Entity\RoadOfLife $roadOfLifeTwo, $allowLessInformation = false)
 {
     $this->LOGGER->debug("Comparing " . $roadOfLifeOne . " with " . $roadOfLifeTwo);
     if (!$this->compareStrings($roadOfLifeOne->getJob(), $roadOfLifeTwo->getJob(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareCountries($roadOfLifeOne->getOriginCountry(), $roadOfLifeTwo->getOriginCountry(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareTerritories($roadOfLifeOne->getOriginTerritory(), $roadOfLifeTwo->getOriginTerritory(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareCountries($roadOfLifeOne->getCountry(), $roadOfLifeTwo->getCountry(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareTerritories($roadOfLifeOne->getTerritory(), $roadOfLifeTwo->getTerritory(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareLocations($roadOfLifeOne->getLocation(), $roadOfLifeTwo->getLocation(), $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($roadOfLifeOne->getFromDate(), $roadOfLifeTwo->getFromDate(), "date", $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($roadOfLifeOne->getToDate(), $roadOfLifeTwo->getToDate(), "date", $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($roadOfLifeOne->getProvenDate(), $roadOfLifeTwo->getProvenDate(), "date", $allowLessInformation)) {
         return false;
     }
     return true;
 }