vendor/bitbag/product-bundle-plugin/src/Menu/AdminProductFormMenuListener.php line 18

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file was created by developers working at BitBag
  4.  * Do you need more information about us and what we do? Visit our https://bitbag.io website!
  5.  * We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
  6. */
  7. declare(strict_types=1);
  8. namespace BitBag\SyliusProductBundlePlugin\Menu;
  9. use BitBag\SyliusProductBundlePlugin\Entity\ProductInterface;
  10. use Sylius\Bundle\AdminBundle\Event\ProductMenuBuilderEvent;
  11. final class AdminProductFormMenuListener
  12. {
  13.     public function addItems(ProductMenuBuilderEvent $event): void
  14.     {
  15.         /** @var ProductInterface $product */
  16.         $product $event->getProduct();
  17.         if (!$product->isBundle()) {
  18.             return;
  19.         }
  20.         $menu $event->getMenu();
  21.         $menu
  22.             ->addChild('bundle')
  23.             ->setAttribute('template''@BitBagSyliusProductBundlePlugin/Admin/Product/Tab/_bundle.html.twig')
  24.             ->setLabel('bitbag_sylius_product_bundle.ui.bundle')
  25.         ;
  26.     }
  27. }