summaryrefslogtreecommitdiff
path: root/app/php/dto/CalendarDTO.php
blob: c7f45e2dbada343fceb49d85d455af02adeb569b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

Prado::using('Application.model.Calendar');

class CalendarDTO {

    public $ID;
    public $Name;
    public $Website;
    public $Image;
    public $Url;
    public $LastUpdated;

    public function loadRecord(Calendar $calendarRecord) {
        $this->ID = $calendarRecord->UID;
        $this->Name = $calendarRecord->CustomName ?: $calendarRecord->Name;
        $this->Website = $calendarRecord->Website;
        $this->Image = $calendarRecord->CustomImageUrl;
        $this->Url = $calendarRecord->CustomUrl;
        $this->LastUpdated = $calendarRecord->LastUpdated;
    }

    public static function __compare(CalendarDTO $cal1, CalendarDTO $cal2) {
        return strcmp($cal1->Name, $cal2->Name);
    }

}

?>