You are here

public function LaravelCacheRepositoryAdapter::remember in Markdown 8.2

File

src/Util/LaravelCacheRepositoryAdapter.php, line 141

Class

LaravelCacheRepositoryAdapter
Adapter for integrating Drupal cache with Laravel.

Namespace

Drupal\markdown\Util

Code

public function remember($key, $ttl, Closure $callback) {
  $value = $this
    ->get($key);
  if (!isset($value)) {
    $value = $callback();
    $this
      ->put($key, $value, $ttl);
  }
  return $value;
}