src/Trident/Component/Caching/CachingProxy.php
public function proxy($key, \Closure $data, $expiration = 0)
    {
        if ($this->driver->has($key)) {
            return $this->driver->get($key);
        }

        // Resolve the 'real' data source
        $data = $data();

        // Value wasn't cached, so cache it for next time
        $this->driver->set($key, $data, $expiration);

        return $data;
    }
public function proxy($key, \Closure $data, $expiration = 0)
    {
        if ($this->driver->has($key)) {
            return $this->driver->get($key);
        }

        // Resolve the 'real' data source
        $data = $data();

        // Value wasn't cached, so cache it for next time
        $this->driver->set($key, $data, $expiration);

        return $data;
    }
public function proxy ( $ key , \ Closure $ data , $ expiration = 0 ) { if ( $ this -> driver -> has ( $ key ) ) { return $ this -> driver -> get ( $ key ) ; } // Resolve the 'real' data source $ data = $ data ( ) ; // Value wasn't cached, so cache it for next time $ this -> driver -> set ( $ key , $ data , $ expiration ) ; return $ data ; }
Get a value, potentially from cache.

@param string  $key
@param Closure $data

@return mixed
Get a value potentially from cache .