ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

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 1 year, 10 months ago.

  • Creator
    Topic
  • #54021

    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
  • #54022

    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

    #54023

    ianfp
    Participant

    Worked perfectly! Thank you!

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

You must be logged in to reply to this topic.

ssossossosso