summaryrefslogtreecommitdiff
path: root/app/php/dto/EventDTO.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/dto/EventDTO.php')
-rw-r--r--app/php/dto/EventDTO.php7
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);
+ }
+
}
?>