OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – Programming Questions Find all Emails associated with a Case

This topic contains 2 replies, has 2 voices, and was last updated by  ianfp 8 years ago.

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

  • Creator
    Topic
  • #25172

    ianfp
    Participant

    Is it possible to write DQL query that finds all Email entities assocated with a Case? I know they’re related because I see a table “oro_rel_265353709e0854fe307b0c” whose columns are “email_id” and “caseentity_id”, and because I see the associated emails from the Case view page!

    I just don’t know how this relationship is modeled in the ORM.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #25173

    Vova Soroka
    Participant

    Hi @ianfp,

    The relationship between Case entity and Email entity is unidirectional many-to-many. The owning side is the Email entity.

    You can do the following:

    The result DQL will be

    where :targetEntityId equals $caseId

    #25174

    ianfp
    Participant

    Worked perfectly! Thank you!

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

The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.

Back to top