コード例 #1
0
ファイル: PersonMerger.php プロジェクト: JhnMhf/SimpleProject
 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;
 }
コード例 #2
0
ファイル: MigrateData.php プロジェクト: JhnMhf/SimpleProject
 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();
 }