PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.2.8
Yatra – Travel Booking & Tour Operator Software v3.0.2.8
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / app / Repositories / GeocodingRepository.php

GeocodingRepository.php in Yatra – Travel Booking & Tour Operator Software 3.0.2.8, at app/Repositories/GeocodingRepository.php

38 lines 848 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Yatra\Repositories;
6
7 use Yatra\Utils\Cache;
8
9 /**
10 * Geocoding response cache (Nominatim). Not DB-backed; centralizes cache keys for external lookups.
11 * Does not wrap {@see get_option()}.
12 */
13 final class GeocodingRepository
14 {
15 public function cacheKeySearch(string $query, int $limit): string
16 {
17 return 'yatra_geo_search_' . md5($query . '|' . $limit);
18 }
19
20 public function cacheKeyReverse(float $lat, float $lng): string
21 {
22 return 'yatra_geo_reverse_' . md5((string) $lat . '_' . (string) $lng);
23 }
24
25 /**
26 * @return mixed
27 */
28 public function getPayload(string $key)
29 {
30 return Cache::get($key);
31 }
32
33 public function setPayload(string $key, $value, int $ttlSeconds): bool
34 {
35 return Cache::set($key, $value, $ttlSeconds);
36 }
37 }
38