getSettings() public method

Get all mail notification settings
public getSettings ( integer $userId ) : stdclass
$userId integer
return stdclass
Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
 public function testShouldInsertAndReturnSettings()
 {
     $this->userMailNotifyCriteria->shouldReceive('getByUserId')->times(2)->andReturn(null, 'mockData');
     $this->userMailNotifyCriteria->shouldReceive('insert')->andReturn(null);
     $service = new MailNotifyService($this->userMailNotifyCriteria);
     $this->assertEquals('mockData', $service->getSettings(1235));
 }
Ejemplo n.º 3
0
 /**
  * 通知設定をONにしてるかどうかチェックする
  *
  * @param string  $type
  * @param int     $userId
  *
  * @return bool
  */
 protected function notificationIsEnabled($type, $userId)
 {
     $colomnName = $type . '_notification_flag';
     $flags = (array) $this->mailNotifyService->getSettings($userId);
     return !!$flags[$colomnName];
 }