Esempio n. 1
0
 public function migrateResidence($person, $residenceOrder, $residenceCountry, $residenceTerritory = null, $residenceLocation = null)
 {
     //insert into new data
     $newResidence = new Residence();
     $newResidence->setPerson($person);
     $newResidence->setResidenceOrder($residenceOrder);
     $newResidence->setResidenceCountry($this->getCountry($residenceCountry));
     $newResidence->setResidenceTerritory($this->getTerritory($residenceTerritory, $residenceLocation));
     $newResidence->setResidenceLocation($this->getLocation($residenceLocation));
     $this->getDBManager()->persist($newResidence);
     $this->getDBManager()->flush();
 }
Esempio n. 2
0
 private function mergeResidenceObjects(\UR\DB\NewBundle\Entity\Residence $dataMasterResidence, \UR\DB\NewBundle\Entity\Residence $toBeDeletedResidence)
 {
     $dataMasterResidence->setResidenceCountry($this->mergeCountryObject($dataMasterResidence->getResidenceCountry(), $toBeDeletedResidence->getResidenceCountry()));
     $dataMasterResidence->setResidenceTerritory($this->mergeTerritoryObject($dataMasterResidence->getResidenceTerritory(), $toBeDeletedResidence->getResidenceTerritory()));
     $dataMasterResidence->setResidenceLocation($this->mergeLocationObject($dataMasterResidence->getResidenceLocation(), $toBeDeletedResidence->getResidenceLocation()));
     return $dataMasterResidence;
 }
Esempio n. 3
0
 public function matchingResidence(\UR\DB\NewBundle\Entity\Residence $residenceOne, \UR\DB\NewBundle\Entity\Residence $residenceTwo, $allowLessInformation = false)
 {
     $this->LOGGER->debug("Comparing " . $residenceOne . " with " . $residenceTwo);
     if (!$this->compareCountries($residenceOne->getResidenceCountry(), $residenceTwo->getResidenceCountry(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareTerritories($residenceOne->getResidenceTerritory(), $residenceTwo->getResidenceTerritory(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareLocations($residenceOne->getResidenceLocation(), $residenceTwo->getResidenceLocation(), $allowLessInformation)) {
         return false;
     }
     return true;
 }