Reference

Guide

$files->intersects()

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

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

Parameters

Name Type Default Description
$other Kirby\Toolkit\Collection

Return type

bool

Example

$images1 = $page->files()->template('cover');
$images2 = $site->files()->template('cover');

if ($images1->intersects($images2) {
    // do something
};

Inherited from

Kirby\Toolkit\Collection

Source code

kirby/src/Toolkit/Collection.php#L562