Owl\Repositories\UserRoleRepositoryInterface::getByUserId PHP Method

getByUserId() public method

public getByUserId ( integer $userId ) : stdClass
$userId integer
return stdClass | null
    public function getByUserId($userId);

Usage Example

Esempio n. 1
0
 /**
  * 指定されたIDのユーザが退会済みかどうかチェック
  *
  * @param int  $userId
  *
  * @return bool
  */
 public function isRetire($userId)
 {
     $status = $this->userRoleRepo->getByUserId($userId);
     if (is_null($status)) {
         return false;
     }
     return $status->name === '退会済み';
 }
UserRoleRepositoryInterface