Return the email nodes, not just the node IDs

This commit is contained in:
Oliver Davies 2025-05-12 08:19:33 +01:00
parent 7e32227e7d
commit 1013305d38
4 changed files with 44 additions and 9 deletions

View file

@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Drupal\opd_daily_emails\Collection;
use Drupal\node\NodeInterface;
final class DailyEmailCollection implements \Countable {
public function __construct(
private array $emails,
) {
}
public function count(): int {
return count($this->emails);
}
public function first(): NodeInterface {
return array_values($this->emails)[0];
}
}