MenuRepository
class MenuRepository
Class MenuRepository
Traits
Constants
DUPLICATE_RETRY_CNT |
Limit count of retry for ID duplicated |
Properties
static protected array | $models | model class name | from EloquentRepositoryTrait |
protected string | $namespace | Namespace for cache | |
protected IdentifierGenerator | $generator | IdentifierGenerator instance |
Methods
Increment a column's value by a given amount.
Decrement a column's value by a given amount.
Cache given callback
Store cache key
Resolve a service instance
Get namespace string for cache group
Find a menu by its primary key. and with relations
Get menu list by site keyword. and with relations
Details
in EloquentRepositoryTrait at line 42
Model
update(Model $item, array $data = array())
update
in EloquentRepositoryTrait at line 56
bool|null
delete(Model $item)
delete
in EloquentRepositoryTrait at line 69
int
increment(Model $item, string $column, int $amount = 1)
Increment a column's value by a given amount.
in EloquentRepositoryTrait at line 82
int
decrement(Model $item, string $column, int $amount = 1)
Decrement a column's value by a given amount.
in EloquentRepositoryTrait at line 92
static string
getModel()
The name of Category model class
in EloquentRepositoryTrait at line 103
static void
setModel(string $model)
Set the name of Category model
in EloquentRepositoryTrait at line 113
Model
createModel()
Create model instance
in EloquentRepositoryTrait at line 125
Builder
query()
query
in EloquentRepositoryTrait at line 137
mixed
__call(string $name, array $arguments)
__call
in CacheableEloquentRepositoryTrait at line 45
mixed
cacheCall(string $method, array $arguments, Closure $closure)
Cache given callback
in CacheableEloquentRepositoryTrait at line 67
protected void
storeCacheKey(string $class, string $cacheKey)
Store cache key
in CacheableEloquentRepositoryTrait at line 82
protected void
clearCache()
Remove all cache data
in CacheableEloquentRepositoryTrait at line 113
protected string
makeHash(array $args)
Make hash string
in CacheableEloquentRepositoryTrait at line 124
protected Application|mixed
resolveContainer(string|null $service = null)
Resolve a service instance
in CacheableEloquentRepositoryTrait at line 134
protected array
getCacheKeys()
Get all cache keys
in CacheableEloquentRepositoryTrait at line 149
protected string
getKeyfile()
Returns a file path for hash keys
in CacheableEloquentRepositoryTrait at line 161
protected string|null
getNamespace()
Get namespace string for cache group
in CacheableEloquentRepositoryTrait at line 171
protected int
getLifetime()
Return cache life time (minute)
at line 72
Menu
create(array $attributes = array())
Create menu
at line 61
__construct(IdentifierGenerator $generator)
MenuRepository constructor.
at line 103
mixed
findWith(string $id, string|array $with = array())
Find a menu by its primary key. and with relations
at line 117
mixed
fetchBySiteKey(string $siteKey, string|array $with = array())
Get menu list by site keyword. and with relations