MenuItemRepository
class MenuItemRepository
Class MenuItemRepository
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 | |
protected Dispatcher | $dispatcher | Event dispatcher instance | |
static protected callable | $provider | Menu model class provider |
Methods
Increment a column's value by a given amount.
Decrement a column's value by a given amount.
The name of Menu model class
Set the name of Menu model
Cache given callback
Store cache key
Resolve a service instance
Get namespace string for cache group
Get menu item list by primary keys
Set aggregator to model
Set menu model class provider
Provide menu model class
Details
in EloquentRepositoryTrait at line 42
Model
update(Model $item, array $data = array())
update
at line 125
bool|null
delete(MenuItem $item)
Delete a menu item
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.
at line 154
static string
getModel()
The name of Menu model class
at line 167
static void
setModel(string $model)
Set the name of Menu 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 91
MenuItem
create(array $attributes = array())
Create menu item
at line 79
__construct(IdentifierGenerator $generator, Dispatcher $dispatcher)
MenuItemRepository constructor.
at line 142
mixed
fetchIn(array $ids, string|array $with = array())
Get menu item list by primary keys
at line 181
static protected void
setAggregator(string $aggregator)
Set aggregator to model
at line 193
static void
setMenuModelProvider(callable $provider)
Set menu model class provider
at line 203
static string
provideMenuModel()
Provide menu model class