abstract class Sectionable extends Driver (View source)

Properties

bool $implicit

Menunjukkan bahwa section caching implisit berdasarkan keynya.

string $delimiter

Pembatas untuk section key implisit.

Methods

bool
has(string $key)

Periksa apakah item ada di cache.

from  Driver
mixed
get(string $key, mixed $default = null)

Ambil sebuah item dari cache.

from  Driver
mixed
retrieve(string $key)

Ambil item dari driver cache.

from  Driver
put(string $key, mixed $value, int $minutes)

Simpan sebuah item ke cache untuk beberapa menit.

from  Driver
forever(string $key, mixed $value)

Simpan sebuah item ke cache selamanya (Aktif selama 5 tahun).

from  Driver
mixed
remember(string $key, mixed $default, int $minutes, string $function = 'put')

Ambil item dari cache, atau taruh item tersebut ke cache dan return default value.

from  Driver
mixed
sear(string $key, mixed $default)

Anbil sebuah item dari cache, atau taruh item tersebut ke cache selamanya (atau 5 tahun).

from  Driver
forget(string $key)

Hapus sebuah item dari cache.

from  Driver
flush()

Hapus seluruh item cache.

from  Driver
int
expiration(int $minutes)

Ambil waktu kedaluwarsa cache (dalam unix timestamp).

from  Driver
mixed
get_from_section(string $section, string $key, mixed $default = null)

Ambil potongan item section dari driver cache.

put_in_section(string $section, string $key, mixed $value, int $minutes)

Simpan potongan item section ke cache.

forever_in_section(string $section, string $key, mixed $value)

Simpan potongan item section ke cache selamanya (atau 5 tahun).

mixed
remember_in_section(string $section, string $key, mixed $default, int $minutes, string $function = 'put')

Ambil potongan item section dari cache, atau simpan dan return nilai defaultnya.

mixed
sear_in_section(string $section, string $key, mixed $default)

Ambil potongan item section dari cache, atau simpan nilai defaultnya.

forget_in_section(string $section, string $key)

Hapus potongan item section dari cache.

string
section_item_key(string $section, string $key)

Ambil nama key item section milik section dan key tertentu.

int|bool
forget_section(string $section)

Hapus keseluruhan section dari cache.

bool
sectionable(string $key)

Indikasi bahwa key bisa terdiri dari beberapa section.

bool
sectioned(string $key)

Cek apakah key terdiri dari beberapa section.

array
parse(string $key)

Ambil section dan key milik sebuah item.

Details

abstract bool has(string $key)

Periksa apakah item ada di cache.

Parameters

string $key

Return Value

bool

mixed get(string $key, mixed $default = null)

Ambil sebuah item dari cache.


     // Ambil sebuah item dari driver cache
     $name = Cache::driver('name');

     // Return default value jika item tidak ditemukan
     $name = Cache::get('name', 'Budi');

Parameters

string $key
mixed $default

Return Value

mixed

abstract protected mixed retrieve(string $key)

Ambil item dari driver cache.

Parameters

string $key

Return Value

mixed

abstract put(string $key, mixed $value, int $minutes)

Simpan sebuah item ke cache untuk beberapa menit.


     // Simpan sebuah item ke cache selama 15 menit
     Cache::put('name', 'Budi', 15);

Parameters

string $key
mixed $value
int $minutes

forever(string $key, mixed $value)

Simpan sebuah item ke cache selamanya (Aktif selama 5 tahun).


     // Simpan sebuah item ke cache selama 15 menit
     Cache::forever('name', 'Budi');

Parameters

string $key
mixed $value

mixed remember(string $key, mixed $default, int $minutes, string $function = 'put')

Ambil item dari cache, atau taruh item tersebut ke cache dan return default value.


     // Ambil sebuah item dari cache, atau taruh item tersebut ke cache selama 15 menit
     $name = Cache::remember('name', 'Budi', 15);

     // Gunakan closure sebagai value item cache
     $count = Cache::remember('count', function() { return User::count(); }, 15);

Parameters

string $key
mixed $default
int $minutes
string $function

Return Value

mixed

mixed sear(string $key, mixed $default)

Anbil sebuah item dari cache, atau taruh item tersebut ke cache selamanya (atau 5 tahun).

Parameters

string $key
mixed $default

Return Value

mixed

abstract forget(string $key)

Hapus sebuah item dari cache.

Parameters

string $key

abstract flush()

Hapus seluruh item cache.

protected int expiration(int $minutes)

Ambil waktu kedaluwarsa cache (dalam unix timestamp).

Parameters

int $minutes

Return Value

int

mixed get_from_section(string $section, string $key, mixed $default = null)

Ambil potongan item section dari driver cache.

Parameters

string $section
string $key
mixed $default

Return Value

mixed

put_in_section(string $section, string $key, mixed $value, int $minutes)

Simpan potongan item section ke cache.

Parameters

string $section
string $key
mixed $value
int $minutes

forever_in_section(string $section, string $key, mixed $value)

Simpan potongan item section ke cache selamanya (atau 5 tahun).

Parameters

string $section
string $key
mixed $value

mixed remember_in_section(string $section, string $key, mixed $default, int $minutes, string $function = 'put')

Ambil potongan item section dari cache, atau simpan dan return nilai defaultnya.

Parameters

string $section
string $key
mixed $default
int $minutes
string $function

Return Value

mixed

mixed sear_in_section(string $section, string $key, mixed $default)

Ambil potongan item section dari cache, atau simpan nilai defaultnya.

Parameters

string $section
string $key
mixed $default

Return Value

mixed

forget_in_section(string $section, string $key)

Hapus potongan item section dari cache.

Parameters

string $section
string $key

abstract protected string section_item_key(string $section, string $key)

Ambil nama key item section milik section dan key tertentu.

Parameters

string $section
string $key

Return Value

string

abstract int|bool forget_section(string $section)

Hapus keseluruhan section dari cache.

Parameters

string $section

Return Value

int|bool

protected bool sectionable(string $key)

Indikasi bahwa key bisa terdiri dari beberapa section.

Parameters

string $key

Return Value

bool

protected bool sectioned(string $key)

Cek apakah key terdiri dari beberapa section.

Parameters

string $key

Return Value

bool

protected array parse(string $key)

Ambil section dan key milik sebuah item.

Parameters

string $key

Return Value

array