src/Menu/AdminProductFormMenuListener.php line 22

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 App\Menu;
  9. use BitBag\SyliusProductBundlePlugin\Entity\ProductInterface;
  10. use Sylius\Bundle\AdminBundle\Event\ProductMenuBuilderEvent;
  11. final class AdminProductFormMenuListener
  12. {
  13.     /**
  14.      * @param ProductMenuBuilderEvent $event
  15.      * @return void
  16.      */
  17.     public function manageAdminProductFormMenuItems(ProductMenuBuilderEvent $event): void
  18.     {
  19.         /** @var ProductInterface $product */
  20.         $product $event->getProduct();
  21.         if (!$product->isBundle()) {
  22.             return;
  23.         }
  24.         $menu $event->getMenu();
  25.         $menu->removeChild('attributes');
  26.     }
  27. }