PHP Class Xpressengine\Menu\Repositories\CacheDecorator

Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Menu\MenuRepository
Afficher le fichier Open project: xpressengine/xpressengine

Protected Properties

Свойство Type Description
$cache Xpressengine\Support\CacheInterface Cache instance
$prefix string Prefix for cache key
$repo Xpressengine\Menu\MenuRepository MenuRepository instance

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
getCacheKey ( string $keyword ) : string String for cache key

Private Methods

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

Method Details

__construct() public méthode

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 méthode

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

createItemModel() public méthode

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

createModel() public méthode

Create new menu model
public createModel ( ) : Menu
Résultat Xpressengine\Menu\Models\Menu

delete() public méthode

Delete menu
public delete ( Menu $menu ) : boolean
$menu Xpressengine\Menu\Models\Menu menu instance
Résultat boolean

deleteItem() public méthode

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

find() public méthode

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

getCacheKey() protected méthode

String for cache key
protected getCacheKey ( string $keyword ) : string
$keyword string keyword
Résultat string

insert() public méthode

Insert menu
public insert ( Menu $menu ) : Menu
$menu Xpressengine\Menu\Models\Menu menu instance
Résultat Xpressengine\Menu\Models\Menu

insertItem() public méthode

Insert menu item
public insertItem ( MenuItem $item ) : MenuItem
$item Xpressengine\Menu\Models\MenuItem menu item instance
Résultat Xpressengine\Menu\Models\MenuItem

update() public méthode

Update menu
public update ( Menu $menu ) : Menu
$menu Xpressengine\Menu\Models\Menu menu instance
Résultat Xpressengine\Menu\Models\Menu

updateItem() public méthode

Update menu item
public updateItem ( MenuItem $item ) : MenuItem
$item Xpressengine\Menu\Models\MenuItem menu item instance
Résultat Xpressengine\Menu\Models\MenuItem

Property Details

$cache protected_oe property

Cache instance
protected CacheInterface,Xpressengine\Support $cache
Résultat Xpressengine\Support\CacheInterface

$prefix protected_oe property

Prefix for cache key
protected string $prefix
Résultat string

$repo protected_oe property

MenuRepository instance
protected MenuRepository,Xpressengine\Menu $repo
Résultat Xpressengine\Menu\MenuRepository