You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lorqu'un event est réutilisé pour faire plusieurs dispatch, par exemple pour réaliser une série d'actions, si la propagation est stoppée lors d'un des dispatch, les suivants ne seront pas réalisés.
Exemple dans CheckoutController, on utilise $orderEvent 3 fois de suite :
Envoyr un clone $orderEvent plutôt qu'un $orderEvent résoud le problème, car seul l'objet event est cloné, les références à d'autres objets (ici l'Order) sont préservées, mais peut poser d'autres problèmes si les attributs de l'event sont modifiés mais doivent circuler.
Ou alors réinitialiser la propagation avant de re-dispatcher l'event ?
The text was updated successfully, but these errors were encountered:
Lorqu'un event est réutilisé pour faire plusieurs dispatch, par exemple pour réaliser une série d'actions, si la propagation est stoppée lors d'un des dispatch, les suivants ne seront pas réalisés.
Exemple dans CheckoutController, on utilise
$orderEvent
3 fois de suite :Si dans l'action réalisé par
ORDER_SET_POSTAGE
la propagation est stoppée (par exemple ici : https://github.com/thelia/thelia/blob/a3519aa478c334e1b303a5e54f7a2b5c1dce341d/core/lib/Thelia/Action/Coupon.php#L259), alors ORDER_SET_DELIVERY_MODULE ne sera pas propagé.Envoyr un
clone $orderEvent
plutôt qu'un$orderEvent
résoud le problème, car seul l'objet event est cloné, les références à d'autres objets (ici l'Order) sont préservées, mais peut poser d'autres problèmes si les attributs de l'event sont modifiés mais doivent circuler.Ou alors réinitialiser la propagation avant de re-dispatcher l'event ?
The text was updated successfully, but these errors were encountered: