summaryrefslogtreecommitdiff
path: root/app/php/facades
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/facades')
-rw-r--r--app/php/facades/CalendarFacade.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/php/facades/CalendarFacade.php b/app/php/facades/CalendarFacade.php
index b15eac3..5f24e28 100644
--- a/app/php/facades/CalendarFacade.php
+++ b/app/php/facades/CalendarFacade.php
@@ -143,7 +143,16 @@ class CalendarFacade extends Facade {
}
public function getCategories() {
- return Category::finder()->findAll('ORDER BY name ASC');
+ $categories = array_map(
+ function($record) {
+ $dto = new CalendarGroupDTO();
+ $dto->loadRecord($record, []);
+ return $dto;
+ },
+ Category::finder()->findAll()
+ );
+ usort($categories, ['CalendarGroupDTO', '__compare']);
+ return $categories;
}
public function get($uid) {