summaryrefslogtreecommitdiff
path: root/app/php/dto/CalendarDTO.php
blob: 446894194beba8102e26fe62266c850074d7b11e (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
30
31
<?php

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

class CalendarDTO {

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

    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;
        $this->GroupID = $calendarRecord->CategoryID;
    }

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

}

?>