protected function notificationIsEnabled($type, $userId) { $colomnName = $type . '_notification_flag'; $flags = (array) $this->mailNotifyService->getSettings($userId); return !!$flags[$colomnName]; }