PHP Class Xpressengine\Menu\Repositories\CacheDecorator

Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Menu\MenuRepository
显示文件 Open project: xpressengine/xpressengine

Protected Properties

Property Type Description
$cache Xpressengine\Support\CacheInterface Cache instance
$prefix string Prefix for cache key
$repo Xpressengine\Menu\MenuRepository MenuRepository instance

Public Methods

Method Description
__construct ( Xpressengine\Menu\MenuRepository $repo, Xpressengine\Support\CacheInterface $cache ) CacheDecorator constructor.
all ( string $siteKey, array $with = [] ) : Menu[] Get all menu
createItemModel ( Menu $menu = null ) : MenuItem Create new menu item model
createModel ( ) : Menu Create new menu model
delete ( Menu $menu ) : boolean Delete menu
deleteItem ( MenuItem $item ) : boolean Delete menu item
find ( string $id, array $with = [] ) : Menu Find a menu
insert ( Menu $menu ) : Menu Insert menu
insertItem ( MenuItem $item ) : MenuItem Insert menu item
update ( Menu $menu ) : Menu Update menu
updateItem ( MenuItem $item ) : MenuItem Update menu item

Protected Methods

Method Description
getCacheKey ( string $keyword ) : string String for cache key

Private Methods

Method Description
getWithKey ( array $with = [] ) : string Get sub key by relationship

Method Details

__construct() public method

CacheDecorator constructor.
public __construct ( Xpressengine\Menu\MenuRepository $repo, Xpressengine\Support\CacheInterface $cache )
$repo Xpressengine\Menu\MenuRepository MenuRepository instance
$cache Xpressengine\Support\CacheInterface Cache instance

all() public method

Get all menu
public all ( string $siteKey, array $with = [] ) : Menu[]
$siteKey string site key
$with array relation
return Xpressengine\Menu\Models\Menu[]

createItemModel() public method

Create new menu item model
public createItemModel ( Menu $menu = null ) : MenuItem
$menu Xpressengine\Menu\Models\Menu menu instance
return Xpressengine\Menu\Models\MenuItem

createModel() public method

Create new menu model
public createModel ( ) : Menu
return Xpressengine\Menu\Models\Menu

delete() public method

Delete menu
public delete ( Menu $menu ) : boolean
$menu Xpressengine\Menu\Models\Menu menu instance
return boolean

deleteItem() public method

Delete menu item
public deleteItem ( MenuItem $item ) : boolean
$item Xpressengine\Menu\Models\MenuItem menu item instance
return boolean

find() public method

Find a menu
public find ( string $id, array $with = [] ) : Menu
$id string menu identifier
$with array relation
return Xpressengine\Menu\Models\Menu

getCacheKey() protected method

String for cache key
protected getCacheKey ( string $keyword ) : string
$keyword string keyword
return string

insert() public method

Insert menu
public insert ( Menu $menu ) : Menu
$menu Xpressengine\Menu\Models\Menu menu instance
return Xpressengine\Menu\Models\Menu

insertItem() public method

Insert menu item
public insertItem ( MenuItem $item ) : MenuItem
$item Xpressengine\Menu\Models\MenuItem menu item instance
return Xpressengine\Menu\Models\MenuItem

update() public method

Update menu
public update ( Menu $menu ) : Menu
$menu Xpressengine\Menu\Models\Menu menu instance
return Xpressengine\Menu\Models\Menu

updateItem() public method

Update menu item
public updateItem ( MenuItem $item ) : MenuItem
$item Xpressengine\Menu\Models\MenuItem menu item instance
return Xpressengine\Menu\Models\MenuItem

Property Details

$cache protected_oe property

Cache instance
protected CacheInterface,Xpressengine\Support $cache
return Xpressengine\Support\CacheInterface

$prefix protected_oe property

Prefix for cache key
protected string $prefix
return string

$repo protected_oe property

MenuRepository instance
protected MenuRepository,Xpressengine\Menu $repo
return Xpressengine\Menu\MenuRepository