Revert "Display calendar items linked to person within search results"

This reverts commit f7ea7e4dbf.
This commit is contained in:
2025-11-12 13:08:54 +01:00
parent f7ea7e4dbf
commit 869880d8f3
4 changed files with 8 additions and 73 deletions

View File

@@ -866,29 +866,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->calendars;
}
/**
* Get next calendars for this person.
* Only returns calendars where this person is in the persons collection and the person property is not null.
*
* @param int $limit Maximum number of calendars to return
*
* @return ReadableCollection<int, Calendar>
*/
public function getNextCalendarsForPerson(int $limit = 5): ReadableCollection
{
$today = new \DateTimeImmutable('today');
$filtered = $this->calendars->filter(
fn (Calendar $calendar) => $calendar->getStartDate() >= $today
&& $calendar->getPerson() === $this
);
$sorted = $filtered->toArray();
usort($sorted, fn ($a, $b) => $a->getStartDate() <=> $b->getStartDate());
return new ArrayCollection(array_slice($sorted, 0, $limit));
}
public function getCenter(): ?Center
{
if (null !== $this->centerCurrent) {