Elcodi\Admin\PluginBundle\Builder\PluginMenuBuilder::buildByPluginCategory PHP Method

buildByPluginCategory() private method

Build by category and place all menu entries inside a family
private buildByPluginCategory ( Elcodi\Component\Menu\Entity\Menu\Interfaces\NodeInterface $parentNode, array $plugins, string $pluginCategory )
$parentNode Elcodi\Component\Menu\Entity\Menu\Interfaces\NodeInterface Parent menu node
$plugins array Plugins
$pluginCategory string Plugin category
    private function buildByPluginCategory(NodeInterface $parentNode, array $plugins, $pluginCategory)
    {
        foreach ($plugins as $plugin) {
            if ($plugin->getCategory() !== $pluginCategory) {
                continue;
            }
            $node = $this->menuNodeFactory->create()->setName($plugin->getConfigurationValue('name'))->setCode($plugin->getConfigurationValue('fa_icon'))->setUrl(['admin_plugin_configure', ['pluginHash' => $plugin->getHash()]])->setEnabled(true);
            $parentNode->addSubnode($node);
        }
        return $this;
    }