original_string: public function setAttribute($userId, $name, $value)
      {
          $row = $this->connection->fetchAssoc('SELECT id FROM fusio_user_attribute WHERE name = :name', ['name' => $name]);
  
          if (empty($row)) {
              $this->connection->insert('fusio_user_attribute', [
                  'user_id' => $userId,
                  'name' => $name,
                  'value' => $value,
              ]);
          } else {
              $this->connection->update('fusio_user_attribute', [
                  'user_id' => $userId,
                  'name' => $name,
                  'value' => $value,
              ], [
                  'id' => $row['id']
              ]);
          }
      }
code: public function setAttribute($userId, $name, $value)
      {
          $row = $this->connection->fetchAssoc('SELECT id FROM fusio_user_attribute WHERE name = :name', ['name' => $name]);
  
          if (empty($row)) {
              $this->connection->insert('fusio_user_attribute', [
                  'user_id' => $userId,
                  'name' => $name,
                  'value' => $value,
              ]);
          } else {
              $this->connection->update('fusio_user_attribute', [
                  'user_id' => $userId,
                  'name' => $name,
                  'value' => $value,
              ], [
                  'id' => $row['id']
              ]);
          }
      }
code_tokens: public function setAttribute ( $ userId , $ name , $ value ) { $ row = $ this -> connection -> fetchAssoc ( 'SELECT id FROM fusio_user_attribute WHERE name = :name' , [ 'name' => $ name ] ) ; if ( empty ( $ row ) ) { $ this -> connection -> insert ( 'fusio_user_attribute' , [ 'user_id' => $ userId , 'name' => $ name , 'value' => $ value , ] ) ; } else { $ this -> connection -> update ( 'fusio_user_attribute' , [ 'user_id' => $ userId , 'name' => $ name , 'value' => $ value , ] , [ 'id' => $ row [ 'id' ] ] ) ; } }
docstring: Sets a specific user attribute
  
  @param integer $userId
  @param string $name
  @param string $value
docstring_tokens: Sets a specific user attribute