Owl\Repositories\UserMailNotificationRepositoryInterface::getByUserId PHP Method

getByUserId() public method

Get data by user ID
public getByUserId ( integer $userId ) : null
$userId integer
return null | \stdclass
    public function getByUserId($userId);

Usage Example

Exemplo n.º 1
0
 /**
  * Get all mail notification settings
  *
  * @param int  $userId
  *
  * @return \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;
 }
UserMailNotificationRepositoryInterface