/** * We setup the notification settings regardless of the client asking the * scope or not. * @param OAuthEvent $event */ public function setupNotificationSettings(OAuthEvent $event) { $person = $this->getUser($event); $client = $event->getClient(); $this->notificationHandler->getSettingsByClient($person, $client); $this->notificationHandler->initializeSettings($person, $client); }
/** * @return PersonNotificationOption */ private function getSettings($notification) { $person = $notification->getPerson(); $category = $notification->getCategory(); $client = $category->getClient(); $settings = $this->notificationHandler->getSettings($person, $category, $client); if (!$settings) { if ($this->notificationHandler->initializeSettings($person, $client)) { $settings = $this->notificationHandler->getSettings($person, $category, $client); } } return reset($settings); }
public function initializeSettings(ClientInterface $client = null) { return $this->handler->initializeSettings($this->person, $client); }