Ejemplo n.º 1
0
 private function mergeRankObjects(\UR\DB\NewBundle\Entity\Rank $dataMasterRank, \UR\DB\NewBundle\Entity\Rank $toBeDeletedRank)
 {
     $dataMasterRank->setLabel($this->mergeStrings($dataMasterRank->getLabel(), $toBeDeletedRank->getLabel()));
     $dataMasterRank->setClass($this->mergeStrings($dataMasterRank->getClass(), $toBeDeletedRank->getClass()));
     $dataMasterRank->setCountry($this->mergeCountryObject($dataMasterRank->getCountry(), $toBeDeletedRank->getCountry()));
     $dataMasterRank->setTerritory($this->mergeTerritoryObject($dataMasterRank->getTerritory(), $toBeDeletedRank->getTerritory()));
     $dataMasterRank->setLocation($this->mergeLocationObject($dataMasterRank->getLocation(), $toBeDeletedRank->getLocation()));
     $dataMasterRank->setFromDate($this->mergeDateReference($dataMasterRank->getFromDate(), $toBeDeletedRank->getFromDate()));
     $dataMasterRank->setToDate($this->mergeDateReference($dataMasterRank->getToDate(), $toBeDeletedRank->getToDate()));
     $dataMasterRank->setProvenDate($this->mergeDateReference($dataMasterRank->getProvenDate(), $toBeDeletedRank->getProvenDate()));
     $dataMasterRank->setComment($this->mergeStrings($dataMasterRank->getComment(), $toBeDeletedRank->getComment()));
     $toBeDeletedRank->setFromDate(null);
     $toBeDeletedRank->setProvenDate(null);
     $toBeDeletedRank->setToDate(null);
     return $dataMasterRank;
 }
Ejemplo n.º 2
0
 public function migrateRank($person, $rankOrder, $label, $class = null, $country = null, $territory = null, $location = null, $fromDate = null, $toDate = null, $provenDate = null, $comment = null)
 {
     //insert into new data
     $newRank = new Rank();
     $newRank->setPerson($person);
     $newRank->setRankOrder($rankOrder);
     $newRank->setLabel($this->normalize($label));
     $newRank->setClass($this->normalize($class));
     $newRank->setCountry($this->getCountry($country));
     $newRank->setTerritory($this->getTerritory($territory, $location));
     $newRank->setLocation($this->getLocation($location));
     $newRank->setFromDate($this->getDate($fromDate));
     $newRank->setToDate($this->getDate($toDate));
     $newRank->setProvenDate($this->getDate($provenDate));
     $newRank->setComment($this->normalize($comment));
     $this->getDBManager()->persist($newRank);
     $this->getDBManager()->flush();
 }