original_string: public function get_consumers_mapped_to_tool($toolid) {
          global $DB;
  
          $consumers = [];
          $consumerrecords = $DB->get_records('enrol_lti_tool_consumer_map', ['toolid' => $toolid], '', 'consumerid');
          foreach ($consumerrecords as $record) {
              $consumers[] = ToolConsumer::fromRecordId($record->consumerid, $this);
          }
          return $consumers;
      }
code: public function get_consumers_mapped_to_tool($toolid) {
          global $DB;
  
          $consumers = [];
          $consumerrecords = $DB->get_records('enrol_lti_tool_consumer_map', ['toolid' => $toolid], '', 'consumerid');
          foreach ($consumerrecords as $record) {
              $consumers[] = ToolConsumer::fromRecordId($record->consumerid, $this);
          }
          return $consumers;
      }
code_tokens: public function get_consumers_mapped_to_tool ( $ toolid ) { global $ DB ; $ consumers = [ ] ; $ consumerrecords = $ DB -> get_records ( 'enrol_lti_tool_consumer_map' , [ 'toolid' => $ toolid ] , '' , 'consumerid' ) ; foreach ( $ consumerrecords as $ record ) { $ consumers [ ] = ToolConsumer :: fromRecordId ( $ record -> consumerid , $ this ) ; } return $ consumers ; }
docstring: Fetches the list of ToolConsumer objects that are linked to a tool.
  
  @param int $toolid
  @return ToolConsumer[]
docstring_tokens: Fetches the list of ToolConsumer objects that are linked to a tool .