$pages->intersection()
Returns a Collection with the intersection of the given elements
$pages->intersection(\Kirby\Toolkit\Collection $other): Kirby\Toolkit\Collection
Parameters
Name | Type | Default | Description |
---|---|---|---|
$other |
Kirby\Toolkit\Collection |
– |
Return type
Example
$articles1 = $page->children()->filterBy('tags', 'water', ',');
$articles2 = $page->children()->filterBy('tags', 'nature', ',');
$intersection = $articles1->intersection($articles2);
dump($intersection);
Inherited from
Kirby\Toolkit\Collection