diff options
author | emkael <emkael@tlen.pl> | 2016-05-13 13:39:06 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-05-13 13:39:06 +0200 |
commit | 64c5f5544fe64fb314ef8602eb3b702bc35d0e11 (patch) | |
tree | 2795b29600dd103938bc1652bf3691e9fe1f1950 /app/php/dto | |
parent | e6227dee47bdfbcb2751f28f7d859ff4420ba5fa (diff) |
* comparator for EventDTO
Diffstat (limited to 'app/php/dto')
-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); + } + } ?> |