-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Labels
Description
Example usage:
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\DependencyInjection\Attribute\AutowireLocator;
use Symfony\Component\Workflow\Attribute\AsTransitionListener;
use Symfony\Component\Workflow\Event\TransitionEvent;
class GenericListener
{
public function __construct(
#[AutowireLocator('workflow', 'name')]
private ServiceLocator $workflows
) {
}
#[AsTransitionListener()]
public function doSomething(TransitionEvent $event): void
{
$workflow = $this->workflows->get($event->getWorkflowName());
}
}
iterator works as well