Skip to content

Kirby 4.5.0

$pages->intersects()

Checks if there is an intersection between the given collection and this collection

$pages->intersects(\Kirby\Toolkit\Collection $other): bool

Parameters

Name Type Default
$other * Kirby\Toolkit\Collection

Return type

bool

Parent class

Kirby\Cms\Pages inherited from Kirby\Toolkit\Collection

Example

$articles1 = $page->children()->filterBy('tags', 'water', ',');
$articles2 = $page->children()->filterBy('tags', 'nature', ',');

if ($articles1->intersects($articles2) {
    // do something
};