public function get(string $type, string $id)
    {
        if ($this->shouldCacheEntity($type, $id)) {
            $key = $this->getKey($type, $id);
            $this->logger->debug('Fetching from cache', [
                'type' => $type,
                'id' => $id,
                'key' => $key,
            ]);
            if ($item = $this->cache->fetch($key)) {
                return $this->serializer->deserialize($item, Model::class, 'json');
            }
        }

        return $this->getFreshDataWithCache(new InternalSqsMessage($type, $id));
    }
public function get(string $type, string $id)
    {
        if ($this->shouldCacheEntity($type, $id)) {
            $key = $this->getKey($type, $id);
            $this->logger->debug('Fetching from cache', [
                'type' => $type,
                'id' => $id,
                'key' => $key,
            ]);
            if ($item = $this->cache->fetch($key)) {
                return $this->serializer->deserialize($item, Model::class, 'json');
            }
        }

        return $this->getFreshDataWithCache(new InternalSqsMessage($type, $id));
    }
public function get ( string $ type , string $ id ) { if ( $ this -> shouldCacheEntity ( $ type , $ id ) ) { $ key = $ this -> getKey ( $ type , $ id ) ; $ this -> logger -> debug ( 'Fetching from cache' , [ 'type' => $ type , 'id' => $ id , 'key' => $ key , ] ) ; if ( $ item = $ this -> cache -> fetch ( $ key ) ) { return $ this -> serializer -> deserialize ( $ item , Model :: class , 'json' ) ; } } return $ this -> getFreshDataWithCache ( new InternalSqsMessage ( $ type , $ id ) ) ; }
Get single entity.

This method will return an API SDK item when given an ID and Type.
If the item should be cached ($this->shouldCache) then we check to
see if the item is in the cache.

- If the item IS in the cache we return it, never hitting the ApiSDK.
- If the item IS NOT in the cache but it CAN be cached we request it
from ApiSDK and cache it (see getFreshDataWithCache())
- If the item IS NOT in the cache and SHOULD NOT be cached, we simply
query the ApiSDK and return without caching.

@return mixed
Get single entity .