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

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

class CalendarDTO {

    public $ID;
    public $Name;
    public $Website;

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

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

}

?>