Return an EventCollection

This commit is contained in:
Oliver Davies 2025-06-10 20:47:23 +01:00
parent 6e19d01eed
commit 8d8bf62f2c
2 changed files with 28 additions and 3 deletions

View file

@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Drupal\opd_presentations\Collection;
use Drupal\paragraphs\ParagraphInterface;
/**
* @implements \IteratorAggregate<ParagraphInterface>
*/
readonly final class EventCollection implements \IteratorAggregate {
/**
* @param ParagraphInterface[] $events
*/
public function __construct(private array $events) {
}
public function getIterator(): \Traversable {
return new \ArrayIterator($this->events);
}
}