Refactor
This commit is contained in:
parent
aa08f702b2
commit
fa5942d4ba
1 changed files with 2 additions and 3 deletions
|
@ -12,11 +12,10 @@ final class Presentation extends Node implements NodeInterface {
|
|||
public const NODE_TYPE = 'presentation';
|
||||
|
||||
public function getPastEvents(): Events {
|
||||
$events = Events::fromEvents($this->get('field_events')->referencedEntities());
|
||||
|
||||
$today = strtotime('today');
|
||||
|
||||
return $events->filter(fn (Event $event) => $event->getEventDate() < $today);
|
||||
return Events::fromEvents($this->get('field_events')->referencedEntities())
|
||||
->filter(fn (Event $event) => $event->getEventDate() < $today);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue