Skip to content

LogicalAnd Criterion

The LogicalAnd Search Criterion matches content if all provided Criteria match.

Arguments

  • criterion - a set of Criteria combined by the logical operator

Example

PHP

1
2
3
4
5
$query->query = new Criterion\LogicalAnd([
        new Criterion\ContentTypeIdentifier('article'),
        new Criterion\SectionIdentifier(['sports', 'news']);
    ]
);

REST API

1
2
3
4
5
6
7
8
<Query>
    <Filter>
        <AND>
            <ContentTypeIdentifierCriterion>article</ContentTypeIdentifierCriterion>
            <SectionIdentifierCriterion>news</SectionIdentifierCriterion>
        </AND>
    </Filter>
</Query>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "Query": {
        "Filter": {
            "AND": {
                "ContentTypeIdentifierCriterion": "article",
                "SectionIdentifierCriterion": "news"
            }
        }
    }
}