Return the email nodes, not just the node IDs
This commit is contained in:
parent
7e32227e7d
commit
1013305d38
4 changed files with 44 additions and 9 deletions
|
@ -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];
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue