Example #1
0
 public function migrateRoadOfLife($person, $roadOfLifeOrder, $originCountry = null, $originTerritory = null, $job = null, $country = null, $territory = null, $location = null, $fromDate = null, $toDate = null, $provenDate = null, $comment = null)
 {
     //insert into new data
     $newRoadOfLife = new RoadOfLife();
     $newRoadOfLife->setPerson($person);
     $newRoadOfLife->setRoadOfLifeOrder($roadOfLifeOrder);
     $newRoadOfLife->setOriginCountry($this->getCountry($originCountry));
     $newRoadOfLife->setOriginTerritory($this->getTerritory($originTerritory));
     $newRoadOfLife->setJob($this->getJob($job));
     $newRoadOfLife->setCountry($this->getCountry($country));
     $newRoadOfLife->setTerritory($this->getTerritory($territory, $location));
     $newRoadOfLife->setLocation($this->getLocation($location));
     $newRoadOfLife->setFromDate($this->getDate($fromDate));
     $newRoadOfLife->setToDate($this->getDate($toDate));
     $newRoadOfLife->setProvenDate($this->getDate($provenDate));
     $newRoadOfLife->setComment($this->normalize($comment));
     $this->getDBManager()->persist($newRoadOfLife);
     $this->getDBManager()->flush();
 }
Example #2
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;
 }
Example #3
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;
 }