PHP Класс Silber\Bouncer\CachedClipboard

Наследование: extends Clipboard
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cache Illuminate\Contracts\Cache\Store The cache store.
$tag string The tag used for caching.

Открытые методы

Метод Описание
__construct ( Illuminate\Contracts\Cache\Store $cache ) Constructor.
getAbilities ( Model $authority, boolean $allowed = true ) : Illuminate\Database\Eloquent\Collection Get the given authority's abilities.
getCache ( ) : Illuminate\Contracts\Cache\Store Get the cache instance.
getFreshAbilities ( Model $authority, boolean $allowed ) : Illuminate\Database\Eloquent\Collection Get a fresh copy of the given authority's abilities.
getRoles ( Model $authority ) : Collection Get the given authority's roles.
refresh ( null | Model $authority = null ) Clear the cache.
refreshFor ( Model $authority ) Clear the cache for the given authority.
setCache ( Illuminate\Contracts\Cache\Store $cache ) Set the cache instance.

Защищенные методы

Метод Описание
deserializeAbilities ( array $abilities ) : Illuminate\Database\Eloquent\Collection Deserialize an array of abilities into a collection of models.
getCacheKey ( Model $model, string $type, boolean $allowed = true ) : string Get the cache key for the given model's cache type.
refreshAllIteratively ( ) : void Refresh the cache for all roles and users, iteratively.
sear ( string $key, callable $callback ) : mixed Get an item from the cache, or store the default value forever.
serializeAbilities ( Illuminate\Database\Eloquent\Collection $abilities ) : array Serialize a collection of ability models into a plain array.

Описание методов

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

Constructor.
public __construct ( Illuminate\Contracts\Cache\Store $cache )
$cache Illuminate\Contracts\Cache\Store

deserializeAbilities() защищенный Метод

Deserialize an array of abilities into a collection of models.
protected deserializeAbilities ( array $abilities ) : Illuminate\Database\Eloquent\Collection
$abilities array
Результат Illuminate\Database\Eloquent\Collection

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

Get the given authority's abilities.
public getAbilities ( Model $authority, boolean $allowed = true ) : Illuminate\Database\Eloquent\Collection
$authority Illuminate\Database\Eloquent\Model
$allowed boolean
Результат Illuminate\Database\Eloquent\Collection

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

Get the cache instance.
public getCache ( ) : Illuminate\Contracts\Cache\Store
Результат Illuminate\Contracts\Cache\Store

getCacheKey() защищенный Метод

Get the cache key for the given model's cache type.
protected getCacheKey ( Model $model, string $type, boolean $allowed = true ) : string
$model Illuminate\Database\Eloquent\Model
$type string
$allowed boolean
Результат string

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

Get a fresh copy of the given authority's abilities.
public getFreshAbilities ( Model $authority, boolean $allowed ) : Illuminate\Database\Eloquent\Collection
$authority Illuminate\Database\Eloquent\Model
$allowed boolean
Результат Illuminate\Database\Eloquent\Collection

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

Get the given authority's roles.
public getRoles ( Model $authority ) : Collection
$authority Illuminate\Database\Eloquent\Model
Результат Illuminate\Support\Collection

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

Clear the cache.
public refresh ( null | Model $authority = null )
$authority null | Illuminate\Database\Eloquent\Model

refreshAllIteratively() защищенный Метод

Refresh the cache for all roles and users, iteratively.
protected refreshAllIteratively ( ) : void
Результат void

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

Clear the cache for the given authority.
public refreshFor ( Model $authority )
$authority Illuminate\Database\Eloquent\Model

sear() защищенный Метод

Get an item from the cache, or store the default value forever.
protected sear ( string $key, callable $callback ) : mixed
$key string
$callback callable
Результат mixed

serializeAbilities() защищенный Метод

Serialize a collection of ability models into a plain array.
protected serializeAbilities ( Illuminate\Database\Eloquent\Collection $abilities ) : array
$abilities Illuminate\Database\Eloquent\Collection
Результат array

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

Set the cache instance.
public setCache ( Illuminate\Contracts\Cache\Store $cache )
$cache Illuminate\Contracts\Cache\Store

Описание свойств

$cache защищенное свойство

The cache store.
protected Store,Illuminate\Contracts\Cache $cache
Результат Illuminate\Contracts\Cache\Store

$tag защищенное свойство

The tag used for caching.
protected string $tag
Результат string