ssossossosso

Forums

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

This topic contains 2 replies, has 2 voices, and was last updated by  ianfp 1 year, 7 months ago.

  • Creator
    Topic
  • #17657

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

    Vova Soroka
    Oro Core

    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

    #17667

    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.