summaryrefslogtreecommitdiff
path: root/app/php/facades/CalendarFacade.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/php/facades/CalendarFacade.php')
-rw-r--r--app/php/facades/CalendarFacade.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/php/facades/CalendarFacade.php b/app/php/facades/CalendarFacade.php
index 5eed764..232acf3 100644
--- a/app/php/facades/CalendarFacade.php
+++ b/app/php/facades/CalendarFacade.php
@@ -96,6 +96,20 @@ class CalendarFacade extends Facade {
$preference->save();
}
+ public function setPreferredCalendars(User $user, $calendars) {
+ //TODO: remove old preference, optionally
+ $transaction = $this->beginTransaction();
+ try {
+ foreach ($calendars as $calendar) {
+ $this->setPreferredCalendar($user, $calendar);
+ }
+ $transaction->commit();
+ } catch (Exception $e) {
+ $transaction->rollback();
+ throw $e;
+ }
+ }
+
public function getEventsForTimeframe(CalendarDTO $calendar,
DateTime $dateFrom,
DateTime $dateTo,