class LayoutManager implements BasicEntityManagerInterface

Class LayoutManager is injected as empire_layout_plugin.backend_layout_manager service. LayoutManager handles the logic for managed entity.

Properties

protected LayoutRepository $repository
protected Parser $ymlParser
protected Filesystem $fileSystem
protected $plugins
protected Dumper $dumper
protected EventDispatcherInterface $dispatcher
protected Client $cache
protected PluginLayoutEventContainer $container

Methods

__construct(LayoutRepository $repository, EventDispatcherInterface $dispatcher, Client $cache, PluginLayoutEventContainer $container)

LayoutManager constructor.

saveLayout(mixed $layout)

Persist layouts in database and file

array|mixed|null
getAllPlugins()

Find all plugins from file

array|mixed|null
getAllPluginsFromCache()

Get cached plugins

editPluginsArray(mixed $layout)

Do plugins change in file and database

mixed
checkForMultipleInstance()

Load plugins from another shop instance

array
getAllPages()

Return all pages to be managed

array
getAllThemePages(bool|mixed|string $theme = FRONTEND_THEME_TITLE)

Return all pages to be managed

bool
saveThemePagesFile(array $routes, bool|mixed|string $theme = FRONTEND_THEME_TITLE)

Save custom layouts to file

bool
addCustomLayout(string $layout)

Add new custom layout

array|string
getPluginsForRoute(string $routeName, array $layouts = null)

Return plugins for route

bool|string
changeLayouts(array $changedItems)

Change layout status and data in file and database

Details

at line 81
__construct(LayoutRepository $repository, EventDispatcherInterface $dispatcher, Client $cache, PluginLayoutEventContainer $container)

LayoutManager constructor.

Parameters

LayoutRepository $repository
EventDispatcherInterface $dispatcher
Client $cache
PluginLayoutEventContainer $container

at line 96
saveLayout(mixed $layout)

Persist layouts in database and file

Parameters

mixed $layout

at line 108
array|mixed|null getAllPlugins()

Find all plugins from file

Return Value

array|mixed|null

See also

AlligatorPluginExtension

at line 128
array|mixed|null getAllPluginsFromCache()

Get cached plugins

Return Value

array|mixed|null

at line 138
editPluginsArray(mixed $layout)

Do plugins change in file and database

Parameters

mixed $layout

at line 177
mixed checkForMultipleInstance()

Load plugins from another shop instance

Return Value

mixed

at line 189
array getAllPages()

Return all pages to be managed

Return Value

array

at line 202
array getAllThemePages(bool|mixed|string $theme = FRONTEND_THEME_TITLE)

Return all pages to be managed

Parameters

bool|mixed|string $theme

Return Value

array

at line 216
bool saveThemePagesFile(array $routes, bool|mixed|string $theme = FRONTEND_THEME_TITLE)

Save custom layouts to file

Parameters

array $routes
bool|mixed|string $theme

Return Value

bool

at line 235
bool addCustomLayout(string $layout)

Add new custom layout

Parameters

string $layout

Return Value

bool

Exceptions

NonUniqueResultException

at line 264
array|string getPluginsForRoute(string $routeName, array $layouts = null)

Return plugins for route

Parameters

string $routeName
array $layouts

Return Value

array|string

at line 292
bool|string changeLayouts(array $changedItems)

Change layout status and data in file and database

Parameters

array $changedItems

Return Value

bool|string