ORM API - can I use ->where(...) with ->findRelated(...)?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arthurmaciel
    Junior Member
    • Jan 2019
    • 15

    ORM API - can I use ->where(...) with ->findRelated(...)?

    Hi! I tried using ->where(...) method in conjunction with ->findRelated(...) and it didn´t work. Is it possible? If so could you present an example?

    Thanks in advance.
    Arthur
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    Hi Arthur,

    No. But you can specify the params argument
    PHP Code:
    ->findRelated($entity, 'linkName', [
       'whereClause' => [
            'attributeName' => 'Value'
       ]
    ]); 
    
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • arthurmaciel
      Junior Member
      • Jan 2019
      • 15

      #3
      Yurikuzn, thanks! Would it be possible to use the 'whereClause' presented to filter dates greater than a specified value? If so, could you please show an example again?
      Best,
      Arthur

      Comment

      • yuri
        Member
        • Mar 2014
        • 8440

        #4
        'dateAttribute>' => '2019-10-10'
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        Working...