Owl\Services\MailNotifyService::getSettings PHP Метод

getSettings() публичный Метод

Get all mail notification settings
public getSettings ( integer $userId ) : stdclass
$userId integer
Результат stdclass
    public function getSettings($userId)
    {
        $flags = $this->mailNotify->getByUserId($userId);
        // HACK: レコード未登録ユーザはレコード挿入する
        // @link https://github.com/owl/owl/pull/75
        if (is_null($flags)) {
            $this->mailNotify->insert($this->getDefaultColomuns($userId));
            return $this->mailNotify->getByUserId($userId);
        }
        return $flags;
    }

Usage Example

Пример #1
0
 /**
  * Configに合わせてメール通知HTMLコンポーネントを返す
  *
  * @return View | null
  */
 protected function renderHtml()
 {
     if ($this->notifyEnable) {
         $notifyFlags = $this->mailNotifyService->getSettings($this->userService->getCurrentUser()->id);
         return view('user.edit._mail-notify', compact('notifyFlags'))->render();
     }
     return null;
 }
All Usage Examples Of Owl\Services\MailNotifyService::getSettings