예제 #1
0
 public function createMergedWeddingObj(\UR\DB\NewBundle\Entity\Wedding $dataMasterWedding, \UR\DB\NewBundle\Entity\Wedding $toBeDeletedWedding)
 {
     //husband/ wife?
     $dataMasterWedding->setWeddingDate($this->mergeDateReference($dataMasterWedding->getWeddingDate(), $toBeDeletedWedding->getWeddingDate()));
     $dataMasterWedding->setWeddingLocation($this->mergeLocationObject($dataMasterWedding->getWeddingLocation(), $toBeDeletedWedding->getWeddingLocation()));
     $dataMasterWedding->setWeddingTerritory($this->mergeTerritoryObject($dataMasterWedding->getWeddingTerritory(), $toBeDeletedWedding->getWeddingTerritory()));
     $dataMasterWedding->setBannsDate($this->mergeDateReference($dataMasterWedding->getBannsDate(), $toBeDeletedWedding->getBannsDate()));
     $dataMasterWedding->setBreakupReason($this->mergeStrings($dataMasterWedding->getBreakupReason(), $toBeDeletedWedding->getBreakupReason()));
     $dataMasterWedding->setBreakupDate($this->mergeDateReference($dataMasterWedding->getBreakupDate(), $toBeDeletedWedding->getBreakupDate()));
     $dataMasterWedding->setMarriageComment($this->mergeComment($dataMasterWedding->getMarriageComment(), $toBeDeletedWedding->getMarriageComment()));
     $dataMasterWedding->setBeforeAfter($this->mergeStrings($dataMasterWedding->getBeforeAfter(), $toBeDeletedWedding->getBeforeAfter()));
     $dataMasterWedding->setProvenDate($this->mergeDateReference($dataMasterWedding->getProvenDate(), $toBeDeletedWedding->getProvenDate()));
     $dataMasterWedding->setComment($this->mergeComment($dataMasterWedding->getComment(), $toBeDeletedWedding->getComment()));
     $toBeDeletedWedding->setWeddingDate(null);
     $toBeDeletedWedding->setBannsDate(null);
     $toBeDeletedWedding->setBreakupDate(null);
     $toBeDeletedWedding->setProvenDate(null);
     return $dataMasterWedding;
 }
예제 #2
0
 public function matchingWedding(\UR\DB\NewBundle\Entity\Wedding $weddingOne, \UR\DB\NewBundle\Entity\Wedding $weddingTwo, $allowLessInformation = false)
 {
     $this->LOGGER->debug("Comparing " . $weddingOne . " with " . $weddingTwo);
     if ($this->unmatchedArrays($weddingOne->getWeddingDate(), $weddingTwo->getWeddingDate(), "date", $allowLessInformation)) {
         return false;
     }
     if (!$this->compareTerritories($weddingOne->getWeddingTerritory(), $weddingTwo->getWeddingTerritory(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareLocations($weddingOne->getWeddingLocation(), $weddingTwo->getWeddingLocation(), $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($weddingOne->getBannsDate(), $weddingTwo->getBannsDate(), "date", $allowLessInformation)) {
         return false;
     }
     if (!$this->compareStrings($weddingOne->getBreakupReason(), $weddingTwo->getBreakupReason(), $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($weddingOne->getBreakupDate(), $weddingTwo->getBreakupDate(), "date", $allowLessInformation)) {
         return false;
     }
     if ($this->unmatchedArrays($weddingOne->getProvenDate(), $weddingTwo->getProvenDate(), "date", $allowLessInformation)) {
         return false;
     }
     if (!$this->compareStrings($weddingOne->getBeforeAfter(), $weddingTwo->getBeforeAfter(), $allowLessInformation)) {
         return false;
     }
     //marriage comment?
     return true;
 }