original_string: protected static function get_queued_adhoc_task_record($task) {
          global $DB;
  
          $record = self::record_from_adhoc_task($task);
          $params = [$record->classname, $record->component, $record->customdata];
          $sql = 'classname = ? AND component = ? AND ' .
              $DB->sql_compare_text('customdata', \core_text::strlen($record->customdata) + 1) . ' = ?';
  
          if ($record->userid) {
              $params[] = $record->userid;
              $sql .= " AND userid = ? ";
          }
          return $DB->get_record_select('task_adhoc', $sql, $params);
      }
code: protected static function get_queued_adhoc_task_record($task) {
          global $DB;
  
          $record = self::record_from_adhoc_task($task);
          $params = [$record->classname, $record->component, $record->customdata];
          $sql = 'classname = ? AND component = ? AND ' .
              $DB->sql_compare_text('customdata', \core_text::strlen($record->customdata) + 1) . ' = ?';
  
          if ($record->userid) {
              $params[] = $record->userid;
              $sql .= " AND userid = ? ";
          }
          return $DB->get_record_select('task_adhoc', $sql, $params);
      }
code_tokens: protected static function get_queued_adhoc_task_record ( $ task ) { global $ DB ; $ record = self :: record_from_adhoc_task ( $ task ) ; $ params = [ $ record -> classname , $ record -> component , $ record -> customdata ] ; $ sql = 'classname = ? AND component = ? AND ' . $ DB -> sql_compare_text ( 'customdata' , \ core_text :: strlen ( $ record -> customdata ) + 1 ) . ' = ?' ; if ( $ record -> userid ) { $ params [ ] = $ record -> userid ; $ sql .= " AND userid = ? " ; } return $ DB -> get_record_select ( 'task_adhoc' , $ sql , $ params ) ; }
docstring: Checks if the task with the same classname, component and customdata is already scheduled
  
  @param adhoc_task $task
  @return bool
docstring_tokens: Checks if the task with the same classname component and customdata is already scheduled