code: public function getAssignment($roleName, $userId)
      {
          if ($this->isEmptyUserId($userId)) {
              return null;
          }
  
          $row = (new Query())->from($this->assignmentTable)
              ->where(['user_id' => (string) $userId, 'item_name' => $roleName])
              ->one($this->db);
  
          if ($row === false) {
              return null;
          }
  
          return new Assignment([
              'userId' => $row['user_id'],
              'roleName' => $row['item_name'],
              'createdAt' => $row['created_at'],
          ]);
      }
docs: {@inheritdoc}