diff --git a/web/modules/custom/opdavies_talks/src/Service/TalkCounter.php b/web/modules/custom/opdavies_talks/src/Service/TalkCounter.php index de522c810..2159bdfba 100644 --- a/web/modules/custom/opdavies_talks/src/Service/TalkCounter.php +++ b/web/modules/custom/opdavies_talks/src/Service/TalkCounter.php @@ -8,6 +8,7 @@ use Carbon\Carbon; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\node\NodeInterface; +use Drupal\opdavies_talks\Entity\Node\Talk; use Drupal\paragraphs\ParagraphInterface; use Illuminate\Support\Collection; @@ -23,7 +24,7 @@ final class TalkCounter { $today = Carbon::today()->format('Y-m-d H:i:s'); return $this->getTalks() - ->flatMap->getEvents() + ->flatMap(fn(Talk $talk) => $talk->getEvents()) ->filter(fn(ParagraphInterface $event) => $event->get('field_date')->getString() <= $today) ->count(); }