25 lines
403 B
PHP
25 lines
403 B
PHP
|
<?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];
|
||
|
}
|
||
|
|
||
|
}
|