original_string: public static function get_individual_conversations_between_users(array $useridsets) : array {
          global $DB;
  
          if (empty($useridsets)) {
              return [];
          }
  
          $hashes = array_map(function($userids) {
              return  helper::get_conversation_hash($userids);
          }, $useridsets);
  
          list($inorequalsql, $params) = $DB->get_in_or_equal($hashes);
          array_unshift($params, self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL);
          $where = "type = ? AND convhash ${inorequalsql}";
          $conversations = array_fill(0, count($hashes), null);
          $records = $DB->get_records_select('message_conversations', $where, $params);
  
          foreach (array_values($records) as $record) {
              $index = array_search($record->convhash, $hashes);
              if ($index !== false) {
                  $conversations[$index] = $record;
              }
          }
  
          return $conversations;
      }
code: public static function get_individual_conversations_between_users(array $useridsets) : array {
          global $DB;
  
          if (empty($useridsets)) {
              return [];
          }
  
          $hashes = array_map(function($userids) {
              return  helper::get_conversation_hash($userids);
          }, $useridsets);
  
          list($inorequalsql, $params) = $DB->get_in_or_equal($hashes);
          array_unshift($params, self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL);
          $where = "type = ? AND convhash ${inorequalsql}";
          $conversations = array_fill(0, count($hashes), null);
          $records = $DB->get_records_select('message_conversations', $where, $params);
  
          foreach (array_values($records) as $record) {
              $index = array_search($record->convhash, $hashes);
              if ($index !== false) {
                  $conversations[$index] = $record;
              }
          }
  
          return $conversations;
      }
code_tokens: public static function get_individual_conversations_between_users ( array $ useridsets ) : array { global $ DB ; if ( empty ( $ useridsets ) ) { return [ ] ; } $ hashes = array_map ( function ( $ userids ) { return helper :: get_conversation_hash ( $ userids ) ; } , $ useridsets ) ; list ( $ inorequalsql , $ params ) = $ DB -> get_in_or_equal ( $ hashes ) ; array_unshift ( $ params , self :: MESSAGE_CONVERSATION_TYPE_INDIVIDUAL ) ; $ where = "type = ? AND convhash ${inorequalsql}" ; $ conversations = array_fill ( 0 , count ( $ hashes ) , null ) ; $ records = $ DB -> get_records_select ( 'message_conversations' , $ where , $ params ) ; foreach ( array_values ( $ records ) as $ record ) { $ index = array_search ( $ record -> convhash , $ hashes ) ; if ( $ index !== false ) { $ conversations [ $ index ] = $ record ; } } return $ conversations ; }
docstring: Returns the conversations between sets of users.
  
  The returned array of results will be in the same order as the requested
  arguments, null will be returned if there is no conversation for that user
  pair.
  
  For example:
  If we have 6 users with ids 1, 2, 3, 4, 5, 6 where only 2 conversations
  exist. One between 1 and 2 and another between 5 and 6.
  
  Then if we call:
  $conversations = get_individual_conversations_between_users([[1,2], [3,4], [5,6]]);
  
  The conversations array will look like:
  [<conv_record>, null, <conv_record>];
  
  Where null is returned for the pairing of [3, 4] since no record exists.
  
  @param array $useridsets An array of arrays where the inner array is the set of user ids
  @return stdClass[] Array of conversation records
docstring_tokens: Returns the conversations between sets of users .