Pop\Cache\Adapter\Sqlite::load PHP Метод

load() публичный Метод

Method to load a value from cache.
public load ( string $id, string $time ) : mixed
$id string
$time string
Результат mixed
    public function load($id, $time)
    {
        $value = false;
        // Retrieve the value.
        $this->sqlite->select()->where()->equalTo('id', ':id');
        $this->sqlite->adapter()->prepare($this->sqlite->render(true))->bindParams(array('id' => sha1($id)))->execute();
        $rows = $this->sqlite->adapter()->fetchResult();
        // If the value is found, check expiration and return.
        if (count($rows) > 0) {
            $data = $rows[0]['value'];
            $dbTime = $rows[0]['time'];
            if (time() - $dbTime <= $time) {
                $value = unserialize($data);
            }
        }
        return $value;
    }