コード例 #1
0
ファイル: PersonMerger.php プロジェクト: JhnMhf/SimpleProject
 private function mergeHonourObjects(\UR\DB\NewBundle\Entity\Honour $dataMasterHonour, \UR\DB\NewBundle\Entity\Honour $toBeDeletedHonour)
 {
     $dataMasterHonour->setLabel($this->mergeStrings($dataMasterHonour->getLabel(), $toBeDeletedHonour->getLabel()));
     $dataMasterHonour->setCountry($this->mergeCountryObject($dataMasterHonour->getCountry(), $toBeDeletedHonour->getCountry()));
     $dataMasterHonour->setTerritory($this->mergeTerritoryObject($dataMasterHonour->getTerritory(), $toBeDeletedHonour->getTerritory()));
     $dataMasterHonour->setLocation($this->mergeLocationObject($dataMasterHonour->getLocation(), $toBeDeletedHonour->getLocation()));
     $dataMasterHonour->setFromDate($this->mergeDateReference($dataMasterHonour->getFromDate(), $toBeDeletedHonour->getFromDate()));
     $dataMasterHonour->setToDate($this->mergeDateReference($dataMasterHonour->getToDate(), $toBeDeletedHonour->getToDate()));
     $dataMasterHonour->setProvenDate($this->mergeDateReference($dataMasterHonour->getProvenDate(), $toBeDeletedHonour->getProvenDate()));
     $dataMasterHonour->setComment($this->mergeStrings($dataMasterHonour->getComment(), $toBeDeletedHonour->getComment()));
     $toBeDeletedHonour->setFromDate(null);
     $toBeDeletedHonour->setProvenDate(null);
     $toBeDeletedHonour->setToDate(null);
     return $dataMasterHonour;
 }
コード例 #2
0
ファイル: MigrateData.php プロジェクト: JhnMhf/SimpleProject
 public function migrateHonour($person, $honourOrder, $label, $country = null, $territory = null, $location = null, $fromDate = null, $toDate = null, $provenDate = null, $comment = null)
 {
     //insert into new data
     $newHonour = new Honour();
     $newHonour->setPerson($person);
     $newHonour->setHonourOrder($honourOrder);
     $newHonour->setLabel($this->normalize($label));
     $newHonour->setCountry($this->getCountry($country));
     $newHonour->setTerritory($this->getTerritory($territory, $location));
     $newHonour->setLocation($this->getLocation($location));
     $newHonour->setFromDate($this->getDate($fromDate));
     $newHonour->setToDate($this->getDate($toDate));
     $newHonour->setProvenDate($this->getDate($provenDate));
     $newHonour->setComment($this->normalize($comment));
     $this->getDBManager()->persist($newHonour);
     $this->getDBManager()->flush();
 }