Exemple #1
0
 public function migrateSource($person, $sourceOrder, $label, $placeOfDiscovery = null, $remark = null, $comment = null)
 {
     //insert into new data
     $newSource = new Source();
     $newSource->setPerson($person);
     $newSource->setSourceOrder($sourceOrder);
     $newSource->setLabel($this->normalize($label));
     $newSource->setPlaceOfDiscovery($this->normalize($placeOfDiscovery));
     $newSource->setRemark($this->normalize($remark));
     $newSource->setComment($this->normalize($comment));
     $this->getDBManager()->persist($newSource);
     $this->getDBManager()->flush();
 }
 private function mergeSourceObjects(\UR\DB\NewBundle\Entity\Source $dataMasterSource, \UR\DB\NewBundle\Entity\Source $toBeDeletedSource)
 {
     $dataMasterSource->setLabel($this->mergeStrings($dataMasterSource->getLabel(), $toBeDeletedSource->getLabel()));
     $dataMasterSource->setPlaceOfDiscovery($this->mergeStrings($dataMasterSource->getPlaceOfDiscovery(), $toBeDeletedSource->getPlaceOfDiscovery()));
     $dataMasterSource->setRemark($this->mergeStrings($dataMasterSource->getRemark(), $toBeDeletedSource->getRemark()));
     $dataMasterSource->setComment($this->mergeStrings($dataMasterSource->getComment(), $toBeDeletedSource->getComment()));
     return $dataMasterSource;
 }
 public function matchingSource(\UR\DB\NewBundle\Entity\Source $sourceOne, \UR\DB\NewBundle\Entity\Source $sourceTwo, $allowLessInformation = false)
 {
     $this->LOGGER->debug("Comparing " . $sourceOne . " with " . $sourceTwo);
     if (!$this->compareStrings($sourceOne->getLabel(), $sourceTwo->getLabel(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareStrings($sourceOne->getPlaceOfDiscovery(), $sourceTwo->getPlaceOfDiscovery(), $allowLessInformation)) {
         return false;
     }
     if (!$this->compareStrings($sourceOne->getRemark(), $sourceTwo->getRemark(), $allowLessInformation)) {
         return false;
     }
     return true;
 }