Exemplo n.º 1
0
 public function migrateReligion($person, $name, $religionOrder, $change_of_religion = null, $provenDate = null, $fromDate = null, $comment = null)
 {
     //insert into new data
     $newReligion = new Religion();
     $newReligion->setPerson($person);
     $newReligion->setName($this->normalize($name));
     $newReligion->setReligionOrder($religionOrder);
     $newReligion->setChangeOfReligion($this->normalize($change_of_religion));
     $newReligion->setComment($this->normalize($comment));
     $newReligion->setProvenDate($this->getDate($provenDate));
     $newReligion->setFromDate($this->getDate($fromDate));
     $this->getDBManager()->persist($newReligion);
     $this->getDBManager()->flush();
 }
Exemplo n.º 2
0
 private function mergeReligionObjects(\UR\DB\NewBundle\Entity\Religion $dataMasterReligion, \UR\DB\NewBundle\Entity\Religion $toBeDeletedReligion)
 {
     $dataMasterReligion->setName($this->mergeStrings($dataMasterReligion->getName(), $toBeDeletedReligion->getName()));
     $dataMasterReligion->setReligionOrder($this->mergeStrings($dataMasterReligion->getReligionOrder(), $toBeDeletedReligion->getReligionOrder()));
     $dataMasterReligion->setChangeOfReligion($this->mergeStrings($dataMasterReligion->getChangeOfReligion(), $toBeDeletedReligion->getChangeOfReligion()));
     $dataMasterReligion->setFromDate($this->mergeDateReference($dataMasterReligion->getFromDate(), $toBeDeletedReligion->getFromDate()));
     $dataMasterReligion->setToDate($this->mergeDateReference($dataMasterReligion->getToDate(), $toBeDeletedReligion->getToDate()));
     $dataMasterReligion->setProvenDate($this->mergeDateReference($dataMasterReligion->getProvenDate(), $toBeDeletedReligion->getProvenDate()));
     $dataMasterReligion->setComment($this->mergeStrings($dataMasterReligion->getComment(), $toBeDeletedReligion->getComment()));
     $toBeDeletedReligion->setFromDate(null);
     $toBeDeletedReligion->setProvenDate(null);
     $toBeDeletedReligion->setToDate(null);
     return $dataMasterReligion;
 }
Exemplo n.º 3
0
 public function matchingReligion(\UR\DB\NewBundle\Entity\Religion $religionOne, \UR\DB\NewBundle\Entity\Religion $religionTwo, $allowLessInformation = false)
 {
     $this->LOGGER->debug("Comparing " . $religionOne . " with " . $religionTwo);
     if (!$this->compareStrings($religionOne->getName(), $religionTwo->getName(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareStrings($religionOne->getChangeOfReligion(), $religionTwo->getChangeOfReligion(), $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($religionOne->getFromDate(), $religionTwo->getFromDate(), "date", $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($religionOne->getProvenDate(), $religionTwo->getProvenDate(), "date", $allowLessInformation)) {
         return false;
     }
     return true;
 }