Commit a086124b authored by Felix Herrmann's avatar Felix Herrmann
Browse files

Merge branch 'fix/menu-registration' into 'master'

Optimized menu registration and changed the array to be able to fit the new menu service

See merge request shopware/plugins/RicoDynamicFAQ!14
parents c50a87ce 4eb7ba1f
......@@ -31,8 +31,8 @@ class RicoMenuLoader
'type' => 'internal',
'linkTarget' => '',
'niceUrl' => false,
'controller' => 'Faq',
'action' => '',
'controllerName' => 'Faq',
'actionName' => '',
'parameter' => [],
],
];
......@@ -66,6 +66,6 @@ class RicoMenuLoader
public function deRegisterEntry()
{
$this->typeService->deRegister(self::GRID_TYPE['typeArgs']['typeName']);
$this->typeService->deRegisterType(self::GRID_TYPE['typeArgs']['typeName']);
}
}
......@@ -9,6 +9,12 @@
<argument>%rico_dynamic_faq.plugin_dir%</argument>
<tag name="shopware.event_subscriber"/>
</service>
<service id="rico_dynamic_faq.subscribers.navigation_subscriber"
class="RicoDynamicFaq\Subscribers\NavigationSubscriber">
<argument type="service" id="service_container" />
<argument type="service" id="models"/>
<tag name="shopware.event_subscriber"/>
</service>
<!-- misc -->
<service class="RicoDynamicFaq\Services\FaqConfigService" id="rico_dynamic_faq.config">
<argument tag="service" id="service_container"/>
......
<?php
/**
* @author: Alexander Wink <alexander.wink@riconet.de>
* @company: Hees riconet GmbH
* @package: RicoGrids
* This file is part of the "RicoDynamicFaq" plugin for shopware.
* @package: RicoDynamicFaq
* @copyright: (c) 2019 Wolf Utz <utz@riconet.de>, Hees riconet GmbH
* @license: For the full copyright and license information,
* please read the LICENSE.txt file that was distributed with this source code.
*/
namespace RicoDynamicFaq\Subscriber;
namespace RicoDynamicFaq\Subscribers;
use Enlight\Event\SubscriberInterface;
use RicoDynamicFaq\Loader\RicoMenuLoader;
use Shopware\Components\DependencyInjection\Container;
use Shopware\Components\Model\ModelManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class NavigationSubscriber
*/
class NavigationSubscriber implements SubscriberInterface
{
/** @var Container */
/** @var ContainerInterface */
private $container;
/** @var ModelManager */
......@@ -26,10 +28,10 @@ class NavigationSubscriber implements SubscriberInterface
/**
* NavigationSubscriber constructor.
*
* @param Container $container
* @param ModelManager $modelManager
* @param ContainerInterface $container
* @param ModelManager $modelManager
*/
public function __construct(Container $container, ModelManager $modelManager)
public function __construct(ContainerInterface $container, ModelManager $modelManager)
{
$this->container = $container;
$this->modelManager = $modelManager;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment