Skip to content

Kirby 5.0.2

$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
$otherrequired Kirby\Toolkit\Collection no default value

Return type

bool

Parent class

Kirby\Cms\Users inherited from Kirby\Toolkit\Collection

Examples

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

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