diff options
Diffstat (limited to 'app/php/dto/EventDTO.php')
-rw-r--r-- | app/php/dto/EventDTO.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/php/dto/EventDTO.php b/app/php/dto/EventDTO.php index 856bcd5..4131210 100644 --- a/app/php/dto/EventDTO.php +++ b/app/php/dto/EventDTO.php @@ -47,6 +47,13 @@ class EventDTO { $this->Calendar->loadRecord($calendars ? array_values($calendars)[0] : $event->Calendar); } + public static function __compare(EventDTO $ev1, EventDTO $ev2) { + if ($ev1->DateString === $ev2->DateString) { + return strcmp($ev1->Calendar->Name, $ev2->Calendar->Name); + } + return strcmp($ev1->DateString, $ev2->DateString); + } + } ?> |