OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions How to edit an entity in a listener class?

This topic contains 4 replies, has 3 voices, and was last updated by  Andrey Yatsenko 4 years, 3 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #29610



    Can anyone give me an example of editing an entity in a listener class? Can I use doctrineHelper?

    • This topic was modified 4 years, 3 months ago by  Adam.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
  • #29612


    Those don’t work:

    $entity = new Table();





    What if I don’t have OnFlushEventArgs $event class? Which class did I suppose to inject into my listener?


    Andrey Yatsenko

    Hi Adam,
    To what event did you subscribe?
    It doesn’t matter what event you will chose, you’ll always have this “$event” in event listener, this can be different type, but anyway.

    If you want to flush on event listener – it’s better to subscribe to

    With first option you have possibility to work with UnitOfWork directly and it’s better for performance reasons.
    But most times second option will be easier to use as there you can flush directly without knowing how UnitOfWork works.

    It’s highly recommended to read this articles in order to understand doctrine event listeners

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top

You will be redirected to [title]. Would you like to continue?

Yes No

You will be redirected to [title]. Would you like to continue?

Yes No