Skip to content

Formula: Nested filters in lookup functions #3422

@yurikuzn

Description

@yurikuzn

Supporting a nested where clause for formula lookup functions. The where item format is the same as for API requests.

Affected functions:

  • record\findOne
  • record\findMany
  • record\findRelatedOne
  • record\findRelatedMany
  • record\exists
  • record\count
  • entity\countRelated
  • entity\sumRelated

Example:

$where = object\create();
$where['type'] = 'or';
$where['value'] = list(
    (
        $it = object\create();
        $it['type'] = 'equals';
        $it['attribute'] = 'name';
        $it['value'] = 'A1';
        $it;
    ),
    (
        $it = object\create();
        $it['type'] = 'equals';
        $it['attribute'] = 'name';
        $it['value'] = 'A2';
        $it;
    )
);


$output = record\findMany('Account', 2, null, null, $where);

Metadata

Metadata

Assignees

Labels

improvementImprovement of existing feature

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions