Announcement

Collapse
No announcement yet.

Merge two whereClause 'OR'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Merge two whereClause 'OR'

    I try to customize accessPortalOnlyAccount.

    whereClause can't have two 'OR' elements - all elements should be in one 'OR' element.

    Return from parent::accessPortalOnlyAccount looks like
    Code:
      "whereClause": [
        {
          "OR": {
            }
       }
      ]
    and only how can I add some conditions to 'OR' is $result['whereClause'][0]['OR'][]=[something].

    I assume that the code


    PHP Code:
    $result['whereClause'][] = [
                    
    'OR' => $or
                
    ]; 
    should be

    PHP Code:
    $result['whereClause']['OR'] =$or
    for clear access in customized function
    PHP Code:
    $result['whereClause']['OR'
    without [0].

    Am I right?




  • #2
    It's made intentionally inside an array to prevent incidental changing (by a programmer) in another place. And also to avoid conflict if 'OR' is already defined by a programmer before ACL applied.

    You just need to build own statement from scratch (in your custom SelectManager class).
    Last edited by yuri; 05-08-2020, 02:01 PM.

    Comment

    Working...
    X