Reference

Guide

$users->intersects()

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

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

Parameters

Name Type Default Description
$other Kirby\Toolkit\Collection

Return type

bool

Example

$users1 = $kirby->users()->role('admin');
$users2 = $page->authors()->toUsers();

if ($users1->intersects($users2) {
    // do something
};

Inherited from

Kirby\Toolkit\Collection

Source code

kirby/src/Toolkit/Collection.php#L562