summaryrefslogtreecommitdiff
path: root/app/php/dto
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-05-13 13:39:06 +0200
committeremkael <emkael@tlen.pl>2016-05-13 13:39:06 +0200
commit64c5f5544fe64fb314ef8602eb3b702bc35d0e11 (patch)
tree2795b29600dd103938bc1652bf3691e9fe1f1950 /app/php/dto
parente6227dee47bdfbcb2751f28f7d859ff4420ba5fa (diff)
* comparator for EventDTO
Diffstat (limited to 'app/php/dto')
-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);
+ }
+
}
?>