src/Charcoal/Cache/Facade/CachePoolFacade.php
public function get($key, callable $resolve = null, $ttl = null)
    {
        $pool = $this->cachePool();
        $item = $pool->getItem($key);
        $data = $item->get();

        if ($item->isHit()) {
            return $data;
        }

        if (is_callable($resolve)) {
            $data = $resolve($data, $item);
            $this->save($item, $data, $ttl);
            return $data;
        }

        return null;
    }
public function get($key, callable $resolve = null, $ttl = null)
    {
        $pool = $this->cachePool();
        $item = $pool->getItem($key);
        $data = $item->get();

        if ($item->isHit()) {
            return $data;
        }

        if (is_callable($resolve)) {
            $data = $resolve($data, $item);
            $this->save($item, $data, $ttl);
            return $data;
        }

        return null;
    }
public function get ( $ key , callable $ resolve = null , $ ttl = null ) { $ pool = $ this -> cachePool ( ) ; $ item = $ pool -> getItem ( $ key ) ; $ data = $ item -> get ( ) ; if ( $ item -> isHit ( ) ) { return $ data ; } if ( is_callable ( $ resolve ) ) { $ data = $ resolve ( $ data , $ item ) ; $ this -> save ( $ item , $ data , $ ttl ) ; return $ data ; } return null ; }
Retrieve the value associated with the specified key from the pool.

This method will call $lambada if the cache item representing $key resulted in a cache miss.

@param  string        $key     The key for which to return the associated value.
@param  callable|null $resolve The function to execute if the cached value does not exist
or is considered expired. The function must return a value which will be stored
in the cache before being returned by the method.

```
$resolve ( mixed $data, CacheItemInterface $item ) : mixed
```

The $resolve takes on two parameters:

1. The expired value or NULL if no value was stored.
2. The cache item of the specified key.
@param  mixed         $ttl     An integer, interval, date, or NULL to use the facade's default value.
@return mixed The value corresponding to this cache item's $key, or NULL if not found.
Retrieve the value associated with the specified key from the pool .