private function mergePropertyObjects(\UR\DB\NewBundle\Entity\Property $dataMasterProperty, \UR\DB\NewBundle\Entity\Property $toBeDeletedProperty) { $dataMasterProperty->setLabel($this->mergeStrings($dataMasterProperty->getLabel(), $toBeDeletedProperty->getLabel())); $dataMasterProperty->setCountry($this->mergeCountryObject($dataMasterProperty->getCountry(), $toBeDeletedProperty->getCountry())); $dataMasterProperty->setTerritory($this->mergeTerritoryObject($dataMasterProperty->getTerritory(), $toBeDeletedProperty->getTerritory())); $dataMasterProperty->setLocation($this->mergeLocationObject($dataMasterProperty->getLocation(), $toBeDeletedProperty->getLocation())); $dataMasterProperty->setFromDate($this->mergeDateReference($dataMasterProperty->getFromDate(), $toBeDeletedProperty->getFromDate())); $dataMasterProperty->setToDate($this->mergeDateReference($dataMasterProperty->getToDate(), $toBeDeletedProperty->getToDate())); $dataMasterProperty->setProvenDate($this->mergeDateReference($dataMasterProperty->getProvenDate(), $toBeDeletedProperty->getProvenDate())); $dataMasterProperty->setComment($this->mergeStrings($dataMasterProperty->getComment(), $toBeDeletedProperty->getComment())); $toBeDeletedProperty->setFromDate(null); $toBeDeletedProperty->setProvenDate(null); $toBeDeletedProperty->setToDate(null); return $dataMasterProperty; }
public function matchingProperty(\UR\DB\NewBundle\Entity\Property $propertyOne, \UR\DB\NewBundle\Entity\Property $propertyTwo, $allowLessInformation = false) { $this->LOGGER->debug("Comparing " . $propertyOne . " with " . $propertyTwo); if (!$this->compareStrings($propertyOne->getLabel(), $propertyTwo->getLabel(), $allowLessInformation)) { return false; } if (!$this->compareCountries($propertyOne->getCountry(), $propertyTwo->getCountry(), $allowLessInformation)) { return false; } if (!$this->compareTerritories($propertyOne->getTerritory(), $propertyTwo->getTerritory(), $allowLessInformation)) { return false; } if (!$this->compareLocations($propertyOne->getLocation(), $propertyTwo->getLocation(), $allowLessInformation)) { return false; } if ($this->unmatchedArrays($propertyOne->getFromDate(), $propertyTwo->getFromDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($propertyOne->getToDate(), $propertyTwo->getToDate(), "date", $allowLessInformation)) { return false; } if ($this->unmatchedArrays($propertyOne->getProvenDate(), $propertyTwo->getProvenDate(), "date", $allowLessInformation)) { return false; } return true; }