events/Classes/Domain/Repository/LocationRepository.php
Daniel Siepmann 00946af6ad
Properly handle latitude and longitude during Destination One import (#32)
They sometimes use a different separator.
The code is adjusted to always use same separator and precision.

That will prevent the same location from showing up multiple times due
to different latitude and longitude values.
2023-07-06 12:39:47 +02:00

21 lines
469 B
PHP

<?php
namespace Wrm\Events\Domain\Repository;
use TYPO3\CMS\Extbase\Persistence\Repository;
use Wrm\Events\Domain\Model\Location;
class LocationRepository extends Repository
{
public function findOneByGlobalId(string $globalId): ?Location
{
$query = $this->createQuery();
return $query
->matching($query->equals('globalId', $globalId))
->setLimit(1)
->execute()
->getFirst()
;
}
}