The EventDispatcher is a Symfony Component provides tools that allow your application components to communicate with each other by dispatching events and listening to them.
Questions tagged [symfony-eventdispatcher]
30 questions
0
votes
0 answers
Pimcore DataObject Events
I am building an application using Pimcore ,an open source software built on the top of symfony framework.I have implemented event listeners to perform validations of data being specified for Data object fields.Into event listener I have implemented…

Rubin Porwal
- 3,736
- 1
- 23
- 26
0
votes
1 answer
whats wrong with this function in this file : vendor\illuminate\events\Dispatcher.php. the vscode editor is throwing an error, i dont know how to sol
I am trying to run a slim project, and its throwing an error from the Dispatcher file. the error is on this function: public function getListeners($eventName)
{
$listeners = $this->listeners[$eventName] ?? [];
$listeners = array_merge(
…

Joe Mutambo
- 11
- 1
0
votes
1 answer
Change subscribed events during runtime (Symfony/Doctrine ED)
Taking the example from https://symfony.com/doc/current/event_dispatcher.html
class ExceptionSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
// return the subscribed events, their…

Daniel W.
- 31,164
- 13
- 93
- 151
0
votes
0 answers
Can't typehint Symfony EventDispatcherInterface to Controller Action
This is my Action
public function indexAction(Request $request,EventDispatcherInterface $dispatcher){
$dispatcher->dispatch(TestEvent::Name, new TestEvent(new test());
...
}
but it throws the error
...MyController::indexAction()" requires that you…

no0ob
- 335
- 4
- 18
0
votes
1 answer
Which EventDispatcher to use in cocos2d ? Node::EventDispatcher or Director::EventDispatcher?
Which EventDispatcher to use in cocos2d ? Node::EventDispatcher or Director::EventDispatcher ?
After referencing the official documentation of both Director class and Node class
Director Class Reference Cocos2d-x
Node Class Reference Cocos2d-x
I am…

Soumya Sengupta
- 105
- 2
- 11
0
votes
1 answer
Accessing request container (event_dispatcher) within a test client
I created a simple test case in Symfony.
So one client which should listen for an event which will be dispatched during an request.
But nothing happen because the request have an own scope or I dont know why Im not able to access the dispatcher in…

Patrick
- 829
- 2
- 13
- 34
0
votes
1 answer
Symfony onKernelRequest headers->set dont received on @Route
I have functionm onKernelRequest when i want to add some custom header(in my case api=true||$request->headers->set('api', "true")) and in all Request $request i can get that header but when i try it on annotation its fail:
onKernelRequest:
public…

Vladyslav Levenets
- 90
- 1
- 9
0
votes
1 answer
Can we dispatch an event from Rabbitmq Consumer in Symfony 4.3?
I'm trying to dispatch a custom event from the Rabbitmq Consumer. This process used to work on Symfony 3.4, recently upgraded the project to Symfony Flex(4.3).
DatasetSubmissionConsumer.php
use…
0
votes
1 answer
Inject EventDispatcher in service doesn't work in production environment - symfony 3.4
let's say I have a listener as a service like this
class MyListener
{
/**
* @var Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
*/
private $dispatcher;
function __construct(ContainerAwareEventDispatcher…

isom
- 304
- 1
- 13
0
votes
1 answer
How in a Symfony 4 pass context to the custom event subscriber?
I'm using Symfony 4 and there are custom event and subscriber, e.g. CustomEvent and CustomEventSubscriber. There is module which dispatch CustomEvent, e.g. CustomModule. And that module is using in the controller (ControllerA) and command…

Andrey Lebedev
- 141
- 1
- 9
0
votes
1 answer
Call postRemove not working
I have a problem with my project :
Not called :
public function postRemove(LifecycleEventArgs $event)
{
$test = 1;
$test1 = 2;
}
Called :
public function preRemove(LifecycleEventArgs $event)
{
$test = 1;
$test1 = 2;
}
Strange that…

GPiter
- 779
- 1
- 11
- 24
-1
votes
1 answer
PreFlush / OnFlush / PostFlush Symfony Doctrine
How can we edit manually final SQL query before execution in Symfony / Doctrine?
I need to change value MANUALLY in SQL, i know i can edit it postPersist in entity, but i'm in a special case that this solution is not working in my schema .
A small…

Titeufggg
- 21
- 3
-1
votes
1 answer
Symfony 2.8 - How to handle datatype of a column different in formBuilder and entity file
In the form builder I have added field with:
type : ChoiceType
multiple : true
In the entityfile that column is defined as:
Type : string
The same column in database table contains type text.
Now I want to insert values selected in form field as…

Sachin Gupta
- 1
- 2
-1
votes
1 answer
When should I switch from Symfony EventDispatcher to RabbitMQ (any *MQ library)?
What I am currently thinking about is that on our platform, number of events generated by users encreases every day (call started, call ended, call record ready, user blocked etc), so when should be the right time to switch from Symfony…

AndrewShmig
- 4,843
- 6
- 39
- 68
-2
votes
1 answer
Symfony 4 Event Dispatcher - is there some solution how to filter value with Event Dispatcher? (like wordpress "add_filter" function)
is there some solution how to filter value/values with Symfony Event Dispatcher like wordpress with add_filter that returns filtered value?
Maybe store properties in Event and edit them with subscriber?

Ajax
- 11
- 3