<?php
namespace App\Admin\EventSubscriber;
use App\Admin\AdminStyle\ProfileAdminStyle;
use App\Profile\Model\Profile;
use Pimcore\Event\Admin\ElementAdminStyleEvent;
use Pimcore\Event\AdminEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* @codeCoverageIgnore
*/
class AdminStyleSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
AdminEvents::RESOLVE_ELEMENT_ADMIN_STYLE => 'resolveElementAdminStyle',
];
}
public function resolveElementAdminStyle(ElementAdminStyleEvent $event)
{
$element = $event->getElement();
if ($element instanceof Profile) {
$event->setAdminStyle(new ProfileAdminStyle($element));
}
}
}