diff options
Diffstat (limited to 'app/frontend/dto/CalendarDTO.php')
-rw-r--r-- | app/frontend/dto/CalendarDTO.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/frontend/dto/CalendarDTO.php b/app/frontend/dto/CalendarDTO.php new file mode 100644 index 0000000..4468941 --- /dev/null +++ b/app/frontend/dto/CalendarDTO.php @@ -0,0 +1,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); + } + +} + +?> |