# yatra/3.0.10/app/Repositories/GeocodingRepository.php

Yatra – Travel Booking &amp; Tour Operator Software, version 3.0.10. 41 lines.

- Page: https://pluginprobe.com/plugins/yatra/3.0.10/code/app/Repositories/GeocodingRepository.php
- Raw: https://pluginprobe.com/plugins/yatra/3.0.10/raw/app/Repositories/GeocodingRepository.php
- Modified: 2026-05-04T10:23:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/3.0.10/code/app/Repositories/GeocodingRepository.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Yatra\Repositories;

use Yatra\Utils\Cache;

/**
 * Geocoding response cache (Nominatim). Not DB-backed; centralizes cache keys for external lookups.
 * Does not wrap {@see get_option()}.
 */
final class GeocodingRepository
{
    /**
     * @param string $schema Bump when search API parameters change (busts stale cache).
     */
    public function cacheKeySearch(string $query, int $limit, string $schema = 'v4'): string
    {
        return 'yatra_geo_search_' . md5($query . '|' . $limit . '|' . $schema);
    }

    public function cacheKeyReverse(float $lat, float $lng): string
    {
        return 'yatra_geo_reverse_' . md5((string) $lat . '_' . (string) $lng);
    }

    /**
     * @return mixed
     */
    public function getPayload(string $key)
    {
        return Cache::get($key);
    }

    public function setPayload(string $key, $value, int $ttlSeconds): bool
    {
        return Cache::set($key, $value, $ttlSeconds);
    }
}

```
