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; }