src/EventListener/AdminStyleListener.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. class AdminStyleListener
  4. {
  5.     public function onResolveElementAdminStyle(\Pimcore\Event\Admin\ElementAdminStyleEvent $event)
  6.     {
  7.         $element $event->getElement();
  8.         // decide which default styles you want to override
  9.         if (get_class($element) == "Pimcore\Model\DataObject\Product") {
  10.             $event->setAdminStyle(new \App\Model\Product\AdminStyle\Product($element));
  11.         } 
  12.         // else if (get_class($element) == "Pimcore\Model\DataObject\Folder") {
  13.         //     $event->setAdminStyle(new \App\Model\Product\AdminStyle\Folder($element));
  14.         // }
  15.     }
  16. }