src/CoreBundle/EventListener/DcGeneral/Table/Attribute/GetAttributeTypeListener.php
protected function wantToHandle(AbstractEnvironmentAwareEvent $event)
    {
        /** @var GetPropertyOptionsEvent $event */
        if (!parent::wantToHandle($event)) {
            return false;
        }
        if ($event->getPropertyName() !== 'type') {
            return false;
        }

        $request = $this->requestStack->getCurrentRequest();
        if ($request->request->get('act', null) === 'select' && !$event->getModel()->getId()) {
            return false;
        }

        return true;
    }
protected function wantToHandle(AbstractEnvironmentAwareEvent $event)
    {
        /** @var GetPropertyOptionsEvent $event */
        if (!parent::wantToHandle($event)) {
            return false;
        }
        if ($event->getPropertyName() !== 'type') {
            return false;
        }

        $request = $this->requestStack->getCurrentRequest();
        if ($request->request->get('act', null) === 'select' && !$event->getModel()->getId()) {
            return false;
        }

        return true;
    }
Test if we want to handle the event.

@param AbstractEnvironmentAwareEvent $event The event to evaluate.

@return bool